diff --git a/README.md b/README.md index 10f5aa9..1464f0e 100644 --- a/README.md +++ b/README.md @@ -29,10 +29,14 @@ import { Comment, InternalLink } from "lezer-markdown-obsidian"; const parser = mdParser.configure([Comment, InternalLink]); ``` -### `ObsidianMDExtensions` +### `Extensions` An array of all the extensions for Obsidian's markdown syntax. +### `BlockAndInline` + +An array of all the extensions except YAML frontmatter. + ### `Comment` This adds support for parsing comments in the form of: `%%comment%%`. @@ -73,6 +77,10 @@ Internal embeds are structured like: The `#heading` and `|display` parts are optional. Heading can be a `#^blockid` instead, and multiple headings can be chained together. +### `Mark` + +This adds support for highlight marks in the form of `==highlighted==`. + ### `TaskList` This adds support for Obsidian's task lists, which allow support for arbitrary characters for tasks. This makes it different from GFM task lists. diff --git a/src/extensions.ts b/src/extensions.ts index 789e072..76c60aa 100644 --- a/src/extensions.ts +++ b/src/extensions.ts @@ -339,7 +339,7 @@ function parseDisplay(cx: InlineContext, start: number): Element | null { return null; } -const MarkDelim = { resolve: "Mark", mark: "MarkMarker" }; +export const MarkDelim = { resolve: "Mark", mark: "MarkMarker" }; export const Mark: MarkdownConfig = { defineNodes: ["Mark", "MarkMarker"], @@ -496,7 +496,7 @@ export const YAMLFrontMatter: MarkdownConfig = { ], }; -export const ObsidianMDExtensions = [ +export const Extensions = [ Comment, Footnote, Hashtag, @@ -509,4 +509,6 @@ export const ObsidianMDExtensions = [ YAMLFrontMatter, ]; -export const parser = defParser.configure(ObsidianMDExtensions); +export const BlockAndInline = Extensions.slice(0, -1); + +export const parser = defParser.configure(Extensions); diff --git a/src/index.ts b/src/index.ts index 33cee51..1b23a0d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,10 +1,11 @@ export { + BlockAndInline, Comment, + Extensions, Footnote, Hashtag, InternalLink, Mark, - ObsidianMDExtensions, parser, TaskList, Tex,