{"id":18006896,"url":"https://github.com/yne/md2dom","last_synced_at":"2025-08-17T13:32:28.339Z","repository":{"id":62277904,"uuid":"537727966","full_name":"yne/md2dom","owner":"yne","description":"Mardown to DOM","archived":false,"fork":false,"pushed_at":"2025-08-01T17:39:29.000Z","size":65,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-09T10:44:02.026Z","etag":null,"topics":["commonmark","dom","javascript","markdown"],"latest_commit_sha":null,"homepage":"https://yne.fr/md2dom","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yne.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-17T07:06:27.000Z","updated_at":"2025-08-01T17:39:33.000Z","dependencies_parsed_at":"2024-10-30T01:44:30.078Z","dependency_job_id":null,"html_url":"https://github.com/yne/md2dom","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"4af4c55def72d1364d3630932cb59b1ead4b673b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yne/md2dom","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yne%2Fmd2dom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yne%2Fmd2dom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yne%2Fmd2dom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yne%2Fmd2dom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yne","download_url":"https://codeload.github.com/yne/md2dom/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yne%2Fmd2dom/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270856561,"owners_count":24657688,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["commonmark","dom","javascript","markdown"],"created_at":"2024-10-30T01:10:53.440Z","updated_at":"2025-08-17T13:32:28.330Z","avatar_url":"https://github.com/yne.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"![logo](logo.svg)\n\nA ~100LoC **safe** [Beyond](https://www.johnmacfarlane.net/beyond-markdown.html) [Markdown](https://spec.commonmark.org/)\nto [`NodeList`](https://developer.mozilla.org/en-US/docs/Web/API/NodeList) parser.\n\n## Usage\n\n```usage.ts\nimport md2dom from \"./md2dom.js\";\n\nconst Md = new md2dom()\nmyDiv.replaceChildren(...Md.parse(\"Hi *me* !\"));\n```\n\n## Limitation\n\nThis parser favor simplicity and safety over backward compatibility.\n\n- all HTML tags (`\u003cscript\u003e`, `\u003c!-- ...`) are rendered as plain text.\n- blockquote use the same block syntax (`\u003e\u003e\u003e` and `\u003c\u003c\u003c`) as block of code\n\n## Demo\n\nSee: [live rendering](//yne.fr/md2dom)\n\n### Inline elements\n\n| render             | Markdown             |\n| ------             | ----                 |\n| *strong word*      | `*strong word*`      |\n| _strong word_      | `_strong word_`      |\n| **emphasis word**  | `**emphasis word**`  |\n| __emphasis word__  | `__emphasis word__`  |\n| ~~strike word~~    | `~~strike word~~`    |\n| :+1:               | `:+1:`               |\n| `inline code`      | `` `inline code` ``  |\n| \u003cftp://user@x.y/z\u003e | `\u003cftp://user@x.y/z\u003e` |\n| \u003cuser@mail.com\u003e    | `\u003cuser@mail.com\u003e`    |\n| [my link](url)     | `[my link](url)`     |\n| ![logo](logo.svg)  | `![logo](logo.svg)`  |\n| [![linked logo](logo.svg)](url) | `[![linked logo](logo.svg)](url)` |\n\nCommonMark syntax are also supported for when precise formating (middle of a word) is needed\n\n| render             | CommonMark           |\n| ------             | ----                 |\n| st{_ron_}g         | `st{_ron_}g`         |\n| em{*pha*}sis       | `em{*pha*}sis`       |\n| high{=li=}ght      | `high{=li=}ght`      |\n| de{-le-}tion       | `de{-le-}tion`       |\n| in{+ser+}tion      | `in{+ser+}tion`      |\n| st{~ri~}ke         | `st{~ri~}ke`         |\n| ~sub~              | `~sub~`              |\n| ^sup^              | `^sup^`              |\n\n### Block elements\n\n#### Code\n\nTo format code into its own distinct block, use at least three ``` syntax.\n\n````\n```prng.c\nint getRandomNumber() {\n  return 4; // chosen by fair dice roll\n}\n```\n````\n\n#### Quote\n\n\u003e blockquote starts with `\u003e`\nand can span on\nmultiple lines\n\n\u003e another distinct blockquote\n\n#### Table\n\nSame as markdown, but with stricter syntax: all rows must *start* and *end* with a `|`.\n\n|A 1 cell table|\n\nIf a separator/align line is found, all it preceding lines become `th`\n\n|Default Header | Left Header | Center Header | Right Header |\n|-------        | :----       | :------:      | -----:       |\n|Default        | Left        | Center        | Right        |\n\n#### List\n\n- first list item\n- same list item\n\n- new list because of new paragraph\n* new list because of type changes\n+ new list because of type changes again\n\n5. numerated list starting at 5\n2. next entry is simply incremented \n\n- unnumbered nesting example\n  - two space is 1 indent\n    -  even deeper\n    -  continued\n  - back to level 2\n- the end\n\n1. number nesting\n    1. dive two level directly\n    1. dive two level directly\n      1. we need to go deeper\n      2. we need to go deeper\n      1. we need to go deeper\n    3. dive two level directly\n  1. back to skiped level 2\n1. back to level 1\n  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyne%2Fmd2dom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyne%2Fmd2dom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyne%2Fmd2dom/lists"}