Hacker News new | ask | show | jobs
by mhd 4194 days ago
Is there some way to sanitize the output? The prevalence of <br><br> is something I've always disliked about WYSIWYG HTML editors (something a markdown converter doesn't have to struggle with, usually).

I can do paragraphs by not manually breaking lines and instead select the second paragraph's content, then apply the "normal text" style, but this isn't exactly intuitive.

Or one could disallow further linebreaks and thus just create paragraphs when you're entering a linebreak.

2 comments

Wordpress has had this forever: http://codex.wordpress.org/Function_Reference/wpautop

Like most of WP, the code is ugly, but battle-tested.

Configuring parser_rules for allowed tags can do a lot, but i think it would not be enough to disable linebreaks alltogether. Thanks for pointing this out. We will consider adding it to configuration.