Comment

Comment by chrismorgan

> Instead of the above syntax combining Markdown and JSON, I could use a Unicode private use area to define bytes that mean “line,” “circle” and so on.

That would not be a good idea because of contention, as you may wish to use those code points for their meaning in some icon font.

You’d be better to use HTML elements, which is the proper way of embedding such stuff in Markdown. (Look, even hijacking code blocks as an extension mechanism is a controversial technique.) And then SVG, or at least a subset of it, becomes an obviously excellent solution; the {"p2":{"x":141,"y":85},"mode":"line","p1":{"x":34,"y":44}} example becomes:

  <svg viewBox="0 0 200 100">
  <path d="M 34 44 L 141 85"/>
  </svg>
parent chrismorgan 4 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton