top | item 44935568

(no title)

pedrovhb | 6 months 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_...

discuss

order

pspeter3|6 months ago

Can you use highlights on text area contents?

lifthrasiir|6 months ago

You can't mainly because <textarea> separately tracks its own selection, AFAIK.

jagged-chisel|6 months ago

The animated exploded demo definitely shows formatting differently from plain text (bold is bold, hyphens replaced with bullets.)

franga2000|6 months ago

Fair, but so do many syntax highlighters (at least bold, italic, titles...).

4b11b4|6 months ago

Ya that's true