5:06 AM
E-BOOKS [31]
TEST [1]
movies [0]
watch movies ol nd u can download
Curriculum Vitae Overview [7]
Interview Questions [3]
Block title

Total online: 1
Guests: 1
Users: 0
Login form
«  August 2011  »
$TOp It
Rate my BLOG
Total of answers: 71
Block title
Main » 2011 » August » 23 » How I Think Posting HTML In Comments Should Work
2:35 AM
How I Think Posting HTML In Comments Should Work

How I Think Posting HTML In Comments Should Work

People post a good bit of HTML in the comments of articles on this site. They are trying to demonstrate something, ask for troubleshooting help, show alternate techniques, etc. This is excellent. I want to encourage this as much as possible. Unfortunately people are often confused on how to do it correctly and get frustrated when it comes out wrong.

I have to post instructions in the comment area to teach people the best way for this site:

  • You can use basic HTML
  • When posting code, please turn all < characters into &lt;
  • If the code is multi-line, use <pre><code></code></pre>

Ideally I'd like to get rid of all of those instructions completely, and have everything "just work". Here are two changes that would get pretty close to ideal for comments on this site:

1. Any HTML that isn't one of the "allowed tags" gets escaped.

WordPress has this default set of allowed tags:

<a href="" title="">
<abbr title="">
<acronym title="">
<blockquote cite="">
<del datetime="">
<q cite="">

If someone uses these tags in a comment, they will apply to that text and render appropriately. If they use any other tag, it should escape, not be stripped or inappropriately render. So:

I'd also say that if it's a single line of code as in this example (does not contain line breaks) it should wrap the newly escaped code in <code></code> tags.

Also, if the code is already escaped like &lt;span&gt; then leave it alone.

2. Make sure multi-line code is wrapped in <pre> tags

If someone puts out multiple lines of code (either they put it in <code> tags or it's not allowed tags so it auto-escapes and auto-code-wraps it), that multi-line code should be wrapped in <pre></pre> tags.

This should also strip whitespace from the beginning and end of the code block, so no extra spaces get rendered. This:


Should turn into:


This would be whether the commenter uses the tags themselves or they are auto-generated based on the above rules.

CMS Agnostic

I'm specifically thinking of WordPress here because that's what I always use, but I can imagine this being useful in any commenting environment that allows some-but-not-all HTML tags and is reasonable that the discussion may involve nerds discussing HTML. Hey maybe this should be a WordPress plugin eh? WINK WINK

Category: LATEST TECHNICAL IMPORTANT NEWS | Views: 2020 | Added by: kc | Rating: 0.0/0
Total comments: 141 2 »
0 Spam
14 cruimmisa  
Fab post :) Makes me wish to change my comment boycott

0 Spam
13 Shirlprursics  
Nice post

0 Spam
12 birepreat  
This valuable tea sort also offers healthful features as well as minimizes the prospect of struggling from cardiovascular system concerns. More and more children are overweight, too. But this may sound like quite a number of teens during the rocky stage of adolescence.
absa banking internet banking logon -
Who knew that in one cup you could possess something that can prevent heart disease, gum diseases, help you lose weight and even cure cancer? They work in the same exact way the seller controls the source and the buyer must buy for life and go broke. The following is only a beginning: as you will see, the story is not finished. The minute you stop smoking your body will start to revive. As this takes place, your body demands more oxygen, so that your breathing increases.
absa banking fixed deposit -
It is believed that severe childhood respiratory conditions, weak immune system and hyperactivity of the respiratory tract are all factors that facilitate the development of asthmatic bronchitis. Music therapy services are available to adults and children with disabilities. The secret formula to get a flat stomach and to get a six pack is a mixture of a low fat diet and a workout routine. To prevent deepening of the scars apply aloe vera gel, cod liver oil or vitamin E oil. Millions are unaware that their blood vessels somewhere in their bodies are 80% to 90% blocked.

0 Spam
11 distubbamma  
Correct Diet The cleanliness in the eating habits is very much necessary for the penis enlargement working. I?? The transportation issue: When it comes to the user of the mobility aid doing a lot of driving and traveling, which device you choose will largely be based on this too. The laser is strong enough to burn the first layer of dead tissue and a few living cells on the surface of the skin, but does not affect the other layers of skin tissue.
citibank login account number - - citibank online trading
Children who suffer from milder forms of autism are usually very intelligent. Every action we've ever taken started as a thought. Once blood flow is changed a natural erection will happen automatically.

0 Spam
10 Hielmaddeme  
One thing that is very helpful is a "Reacher Arm". * Muira Pauma Bark Extract - this wood extract known as the potency wood is the ultimate cure for sexual disfunction and as stimulant to increase sexual virility and potency in men as was used for centuries by the indigenous tribes in South America.. Some of these products may be effective treatment for toenail fungus.
zithromax rx list - - best erectile dysfunction drugs
erectile dysfunction diabetes
Rose essential oil, for instance, is known for aiding during times of grief and sorry. Once this happens, anxiety and psychological factors can make it even more difficult. The herb is also used to treat vertigo, Alzheimer's, and ADD (Attention Deficit Disorder).
zithromax dose for chlamydia - - erectile dysfunction frequency
erectile dysfunction acupuncture
Do not comprehend this illness as something abnormal. Could it be cancer, heart disease, diabetes, or strokes? That's because every part of your body needs a supply of blood including any excess fat you are carrying.
erectile dysfunction differential diagnosis - - caffeine and erectile dysfunction
organic erectile dysfunction

0 Spam
9 beepminaenedy  
о, Всыпать зелень, влить немного белого сухого вина и поварить еще минуту, затем снять с огняПредставьте себе, что среди молодого поколения мужчин (я сейчас говорю о возрасте от 25 до 35 лет) процент тех, кому знакомы чувства ответственности за свои поступки и слова, за свою женщину, за своего ребенка, за обеспечение семьи - ничтожно мал

0 Spam
8 rhibfehadia

0 Spam
Jestesmy specjalistyczna galwanizernia, ktora realizuje zlecenia standardowe i nietypowe, w ilosciach zarowno jednostkowych, jak i przemyslowych.
Dlaczego my?
Wieloletnia wspolpraca z firmami z branzy motoryzacyjnej, elektrochemicznej, elektronicznej, elektrotechnicznej, przemyslu maszynowego i odlewniczego, wojskowego, lotniczego, gorniczego, galanteryjnego i jubilerskiego, sprawia, ze wykonywane w naszym zakladzie uslugi galwanizacyjne doprowadzilismy do perfekcji.
Ufajac nam otrzymuja Panstwo w zamian:
-fachowa porade naszych specjalistow, dotyczaca optymalizacji pokryc powierzchni detali w zaleznosci od ich przeznaczenia
-indywidualne podejscie do kazdego zlecenia (nietypowe ilosci detali, optymalne terminy realizacji, konkurencyjne ceny)
-pokrycie detali warstwami z dokladnoscia do 0,5µm
-usluge najwyzszej jakosci, zgodna z normami Unii Europejskiej, potwierdzona na Panstwa zyczenie certyfikatem z pomiaru grubosci i jednorodnosci polozonych warstw, przeprowadzonego za pomoca spektrometru X-Strata 960 firmy Oxford Instruments (nieniszczaca metoda EDXRF-fluorescencja rentgenowska)
Uslugi galwanizacyjne
W naszej ofercie oprocz konwencjonalnych uslug galwanizacyjnych znajda Panstwo wysokospecjalistyczne rodzaje technik pokrywania powierzchni w zaleznosci od przyszlego zastosowania detali.
Zlocenie elementow pracujacych mechanicznie, narazonych na scieranie. Najlepsza metoda pokrywania warstwa zlota twardego dla tego typu przedmiotow jest zlocenie elektrolityczne w kapielach slabo kwasnych. Technologia ta gwarantuje zwiekszona odpornosc na scieranie dzieki domieszce niklu. Metoda szczegolnie zalecana do zlocenia stykow i zlaczy elektrycznych.
Zlocenie stali nierdzewnych bez utraty polysku podloza
Zlocenie selektywne detali pozwalajace w znaczny sposob obnizyc koszy zlocenia
Zlocenie technologia litograficzna umozliwiajaca zlocenie plytek drukowanych, numizmatow itp.
Zlocenie stali szlachetnych bez podwarstwy
Zlocenie aluminium i stopow ZnAl
Zlocenie miedzi, mosiadzu, brazu i jego stopow
Srebrzenie stykowe do pokrywania kontaktow elektrycznych, przewodzacych duze prady lub duze czestotliwosci
Srebrzenie aluminium
Srebrzenie miedzi, mosiadzu i brazu
Srebrzenie stali na podwarstwie niklu lub miedzi
Srebrzenie chemiczne
Niklowanie chemiczne
Proces ten prowadzi do powstania bardzo twardych, odpornych na scieranie warstw niklowo-fosforowych. Ze wzgledu na swoje wlasciwosci fizyczno-chemiczne powloki te w wiekszosci aplikacji zastapic moga chromowanie. Oferujemy:
Niklowanie stali szlachetnej
Niklowanie aluminium
Niklowanie miedzi, mosiadzu, brazu i jego stopow
Mozemy Panstwu zaproponowac:
Anodowanie twarde
Barwienie aluminium
Piaskowanie powierzchni aluminium
Lakiernia proszkowa
Oprocz technik galwanizacyjnych wykonujemy malowanie powierzchni metoda proszkowa.
Pomiary rentgenowskie warstw galwanicznych
Mozemy rowniez zaproponowac Panstwu pomiary grubosci jak i skladu pierwiastkowego pokryc galwanicznych, stopow, folii, kapieli i innych powlok szybka nieniszczaca metoda EDXRF (fluorescencja rentgenowska), przeprowadzana z uzyciem spektrometru X-Strata 960 firmy Oxford Instruments. Zapewniamy doskonala identyfikacje materialow wielopierwiastkowych od Ti22 do U92.

0 Spam
6 kexttried  
Good day!
Happy New Year!
Health, luck and love!

0 Spam
5 Flammamon  
Hello. And Bye Marry. IT was nice to see you at this sweet suger house.

1-10 11-14
Only registered users can add comments.
[ Registration | Login ]