statamic / v2-hub

Statamic 2 - Feature Requests and Bug Reports
https://statamic.com
95 stars 5 forks source link

Bug: HTML in Bard Markdown field should not be parsed #1846

Open mikemartin opened 6 years ago

mikemartin commented 6 years ago

There are some cases where HTML for links, bold and italics may exist in markdown content. It looks like the HTML is getting parsed and cannot be edited without the toolbar or source.

screenshot 2018-03-20 10 11 02

jackmcdade commented 6 years ago

This is a tricky one. The field itself is contenteditable, which means no matter what we do it's gonna be renderable HTML. That's battle number 1.

Next up, I can try to convert any possible HTML to Markdown on load beforehand using a library like Turndown, but it ends up funky in a new way. Like this:

image

contenteditable is determined to not allow this area to act like a textarea no matter what we do. 🤔