• 0 Posts
  • 2.64K Comments
Joined 9 months ago
cake
Cake day: September 27th, 2023

help-circle











  • If I wanted a WYSIWYG field I’d probably still use markdown. I could add the buttons to properly inject markdown symbol and use a JS markdown renderer for the text field. Tbh I’d be amazed if there weren’t at least a dozen out-of-the-box packages that included a live rendered text area with a widget array.

    In this instance I’m not advocating for markdown as a user interface but just using it as a quick and dirty markup language. Be aware that if you turn to HTML, you’d be adopting responsibility for a lot of non-trivial security issues. If the customization went beyond markdown (into, for instance, fonts) you’d need a more complex solution so you’d likely want to investigate other tag or boundary marker based markup languages out there. Markdown is just simple and has ten billion implementations out there.


  • That is a very unlikely approach.

    Rich text in the modern world is almost exclusively solved by using markdown because it’s such a trivial solution.

    In previous words it was usually solved either using range tags (similar to HTML, sometimes literally HTML, more often custom stuff) or embedded boundary markers (something that marked a new boundary and then had a full definition of the styles to follow, sometimes omitting styles that didn’t change, often times in some insanely dense binary format for predictable scanning).

    Usually, it’s more sane to embed formatting in the string itself rather than having styling separately defined (i.e. CSS, kinda). Because otherwise storage would be a huge pain and reading would require a lot of non-consecutive disk scans.