leeoniya / reMarked.js

client-side HTML > markdown
http://leeoniya.github.io/reMarked.js/
396 stars 97 forks source link

Empty <strong> tag gets converted to ***** #33

Closed ghost closed 10 years ago

ghost commented 10 years ago

An empty <strong> tag gets converted as ****. I think the tag should be ignored.

leeoniya commented 10 years ago

the goal of reMarked is to reproduce the html given to it rather than what the user sees on the screen. if there is an empty <strong> tag in the html, it will also be there in the markdown.

you should probably pre-process the html to remove empty tags from it. while it may be a useful option to add, i'd like to encourage people not to create a sea of useless empty tags and expect other libraries to ignore them. garbage in, garbage out.

leeoniya commented 10 years ago

i'll think about it...

leeoniya commented 10 years ago

i've decided not to do this.

after starting working on this, the required changes will add a significant amount of code since the render functions are fairly node-specific (not really inherited) and each will need the same logic added to determine whether to wrap empty nodes with tags (where needed) and also with markdown-specific characters. not worth it.

i'll commit the partial work-in-progress to another branch, so feel free to add the remaining code in your own version, but i won't be doing more work on this.

leeoniya commented 10 years ago