Hacker News new | past | comments | ask | show | jobs | submit login
How I Think Posting HTML In Comments Should Work (css-tricks.com)
11 points by joshuacc on Aug 19, 2011 | hide | past | favorite | 5 comments



Why not just use markdown? There's no chance of messing up the escaping, and there's no knowledge of html required for your commenters.

Want to make something italic for emphasis? Encase it in asterisks. Want to make it more emphasized? Encase it in two. Links are reasonably simple, too (if you decide to allow them). Quoting someone, either indent it by a few spaces or put a > char in front of it, depending on the implementation.

Or skip markdown and use wikitext or bbcode.

It's easy for you, it's easy for your site visitors.


Completely agreed. The method described in the article requires commenters to use HTML tags and even know how to balance them. In addition, it is supposed to detect code blocks automagically, which would be prone to errors. (How do you know whether a block of text is English or Python?)

Markdown is terse, easy to write, and readable even when rendered in plain text. There's a reason why so many web sites, from Reddit to Github to Stack Exchange, uses Markdown exclusively.

As for the alternatives: Wikitext ''seriously'' '''overloads''' the '''''apostrophe''''', often needs to be supplemented with <u>HTML</u> anyway, and contains [[wiki-specific syntax]] which is not relevant in most blog-commenting situations. BBCode is just a bastardized subset of HTML. It's popular in old-fashioned forum software, but I see no reason to use it in new applications.


Absolutely agree about bbcode, i was just using it as an example since i couldn't think of any good markdown replacements besides wikitext.


There's Textile, but its handling of blockquotes and code samples is much less convenient than Markdown. Github's wiki used to use Textile, and it sucked.


One case I can think of is HTML must be allowed in comments for some WYSIWYG libraries that can't output Markdown/BBcode or WhateverMarkup. If most user of the website is using WYSIWYG with only selective few prefers plain text editing, the ideas in this article might make sense.

Though, instead of went through all the trouble, I'd rather force my users to use Markdown + wmd than trying to deal with HTML in comments.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: