pen icon indicating copy to clipboard operation
pen copied to clipboard

Does not actually generate valid Markdown for bold, italic or bold-italic

Open richjeffery opened this issue 7 years ago • 1 comments

There's an issue in the rendering of Markdown for Bold, Italic or Bold-Italic.

The Markdown clearly specification states that *Italic* should produce italic, **bold** will produce bold, and therefore ***bold-italic*** produces bold-italic .

However, there is code in pen.js that states 'italic' is ***italic*** and bold-italic is **bold-italic** which is wrong (it produces Bold-Italic and Bold respectively).

If you pasted the result of the generated code into any markdown processor it would not reproduce what you'd typed correctly.

richjeffery avatar Nov 13 '17 15:11 richjeffery

For reference:

  • line 827: i: [/<i\b[^>]*>(.*?)<\/i>/ig, '***$1***'], and
  • line 847: return html.replace(/\*{5}/g, '**');

richjeffery avatar Nov 13 '17 15:11 richjeffery