5 ms·
Nice! Seems very useful if you can drop in and have everything work. Nitpicking a bit: it's not as much _rendering_ markdown as it's _syntax highlighting_ it.
by pedrovhb 1y ago
Nice! Seems very useful if you can drop in and have everything work.
Nitpicking a bit: it's not as much _rendering_ markdown as it's _syntax highlighting_ it. Another interesting approach there could be to use the CSS Custom Highlight API [0]. Then it wouldn't need the preview div, and perhaps it'd even be possible to have non-mono fonts and varying size text for headers.
[0] https://developer.mozilla.org/en-US/docs/Web/API/CSS_Custom_Highlight_API https://developer.mozilla.org/en-US/docs/Web/API/CSS_Custom_...
- jagged-chisel 1y agoThe animated exploded demo definitely shows formatting differently from plain text (bold is bold, hyphens replaced with bullets.)
- 4b11b4 1y agoYa that's true
- franga2000 1y agoFair, but so do many syntax highlighters (at least bold, italic, titles...).
- pspeter3 1y agoCan you use highlights on text area contents?
- lifthrasiir 1y agoYou can't mainly because <textarea> separately tracks its own selection, AFAIK.
- scottfr 1y agoThere is a proposal to add support for this: https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/FormControlRange/explainer.md https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/...