On this page
parse-md
Prev: astree | Up: projects | Next: parse-html5
Rel: wispsy, Foundation, prettynb
Ref: wispsy on GitHub
Tags: #public #wispsy #project #foundation #tier/core
Role
Bounded, source-preserving Markdown parsing and safe typed HTML rendering (CommonMark + opt-in EXTENDED dialect for tables, tasks, footnotes, TOC, and wiki/image syntax) with zero runtime dependencies.
Install
python -m pip install parse-md
Quickstart
from parse_md import EXTENDED, parse, render
doc = parse("# Heading\n\n**Hello**.\n")
assert "<strong>Hello</strong>" in doc.to_html()
result = render("| A | B |\n| --- | --- |\n| one | two |\n", dialect=EXTENDED)
assert "<table>" in result.html
When to Reach for It
- Parsing Markdown into source-span-preserving typed nodes and rendering safe HTML without third-party Markdown stacks.
- Resolving custom wiki/image destinations via application callbacks without coupling to a specific notebook engine.
Gotchas & Pitfalls
- CommonMark default vs.
EXTENDED: Tables, task lists, footnotes, TOC, and wiki/image syntax require opting into theEXTENDEDdialect—plainparse()sticks to CommonMark. - Caller-owned wiki/image resolution:
parse-mdparses wiki links into typed nodes but does not touch the filesystem; pass application callbacks (as prettynb does) to resolve destinations. - Bounded & safe HTML output: Rendering escapes raw/unsafe HTML by default and enforces explicit input/nesting bounds on Python
>=3.14.
Pairs With
- prettynb — Downstream publisher for interconnected Markdown notebooks.
- escape-colors — Uses
parse-mdfor optional terminal Markdown layout.
Metadata
type: project-card
slug: parse-md
org: wispsy
repo: wispsy/parse-md
package: parse-md
version: 0.1.0
requires_python: ">=3.14"
layer: foundation
topic: wispsy-foundation
status: active
language: python
source_docs: README.md, docs/
Linked from
Related notes
- wiki/projects/astree Linked here; links to this page; shared tags: #foundation, #project, #tier, #wispsy
- wiki/projects/escape-colors Linked here; links to this page; shared tags: #foundation, #project, #tier, #wispsy
- wiki/projects/parse-html5 Linked here; links to this page; shared tags: #foundation, #project, #tier, #wispsy
- wiki/projects/prettynb Linked here; links to this page; shared tags: #project, #tier, #wispsy
- wiki/stack/foundation Linked here; links to this page; shared tags: #foundation, #tier, #wispsy
- wiki/projects Linked here; links to this page; shared tags: #wispsy
- wiki/projects/parse-mw links to this page; shared tags: #foundation, #project, #tier, #wispsy
- wiki/projects/parse-xml1 links to this page; shared tags: #foundation, #project, #tier, #wispsy
- wiki/projects/parse-yaml links to this page; shared tags: #foundation, #project, #tier, #wispsy
- wiki/choosing links to this page; shared tags: #tier, #wispsy