showdownjs / showdown

A bidirectional Markdown to HTML to Markdown converter written in Javascript

Home Page:http://www.showdownjs.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nonstandard HTML comment endings

hohMiyazawa opened this issue · comments

Current Firefox and Chromium accept --!> as endings for HTML comments.

This is nonstandard, as HTML comments should end with -->. The standard does however disallow --!> inside comment strings, and as such, browsers are lenient and accept it as a comment ending anyway.

HTML comments are detected with a regex here, only matching -->:

}, '^ {0,3}<!--', '-->', 'gm');

This potentially causes a mismatch between visible and invisible page content.