showdownjs / showdown

A bidirectional Markdown to HTML to Markdown converter written in Javascript
http://www.showdownjs.com/
MIT License
14.1k stars 1.57k forks source link

Showdown fails to parse anything inside a div or span? #976

Open jeffersoneagley opened 1 year ago

jeffersoneagley commented 1 year ago

Hi,

I have the following sample input somebody provided:

Input:

<div data-wrapper="true" style="font-family:'Segoe UI','Helvetica Neue',sans-serif; font-size:9pt">\n<div><span style="font-size:10pt"><u>sending this message from</u><strong> the new </strong><em>rich text editor</em></span></div>\n</div>

Actual:

<div data-wrapper=\\"true\\" style=\\"font-family:'Segoe UI','Helvetica Neue',sans-serif; font-size:9pt\\"><div><span style=\\"font-size:10pt\\"><u>sending this message from</u><strong> the new </strong><em>rich text editor</em></span></div></div>

Expected:

__sending this message from__ ** the new ** *rich text editor*

It's an output from a Dynamics CRM rich text editor, which unfortunately includes a div and span around it. These seem to break Showdown's ability to parse to Markdown. Also underlines don't work either HTML->MD.

Am I missing something?

brunolm commented 7 months ago

Something as simple as <div>hello world</div> doesn't work. This issue has been open since March, I guess we need to find an alternative.

stoefln commented 7 months ago

Same here