MarkupExtractorclass
new MarkupExtractor()
| Return | |
|---|---|
MarkupExtractor | File extractor for Markdown files. |
File extractor for Markdown files.
- Stores the markdown text as
content; rendering happens at output time via<Markup>. - Sets
titlefrom the first# h1heading if one is present — otherwise leaves it undefined
(a confident title only). - When a
titleis found, strips the leading# h1fromcontentso renderers (which showtitleseparately) don't display the heading twice. - Sets
descriptionto the first prose paragraph as a plain-text summary (used for card listings and<meta>).
Examples
new MarkupExtractor().extract(Bun.file("/abs/path/README.md"))