Skip to content

Parse Markdown feature descriptions #3687

@FloEdelmann

Description

@FloEdelmann

Originally posted by @fregante in #3678 (comment):

I'd like to see the most lightweight Markdown parser being run directly to the description text to store HTML so the entire parseDescription function can be dropped.

Parser example: Holixus/nano-markdown
bundlephobia.com/result?p=nano-markdown@1.2.1

I've done a little comparison between multiple lightweight Markdown parsers, and I don't think we can directly use any of them 🙁

Features they should support:

  1. code span with single backtick: `` ` ``
  2. code span with a backticked word: `` `bla` ``
  3. inline URLs: https://example.org or <https://example.org>
  4. don't escape HTML tags: **bold** or <b>bold</b>
Parser Size 1. single backtick 2. backticked word 3. inline URLs 4. don't escape HTML
nano-markdown 2kB ✔️
snarkdown 2kB ✔️
downa 1.9kB ✔️
md.js 2.7kB ✔️
tinydown 4kB ✔️ ✔️
drawdown 1.5kB 1) ✔️
mmd.js 0.8kB 2)

Notes:

  1. not distributed via npm, 2.8kB unminified, about 1.5kB minified
  2. not distributed via npm, 1.0kB unminified, 0.8kB minified

Metadata

Metadata

Assignees

No one assigned

    Labels

    metaRelated to Refined GitHub itself

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions