documents: the whole-file parse options are public, for export
CI / platforms (windows-latest) (push) Failing after 7s
CI / site (push) Successful in 21s
CI / crate (push) Failing after 11m35s
CI / platforms (ubuntu-24.04) (push) Canceled after 0s

This commit is contained in:
ZacharyZhang-NY committed 2026-10-12 10:01:55 -04:00
1 parent cec9689f26
commit fd8c98f3b1
2 files changed
+9 -3

No files matched your search

+8 -3
View File
@@ -23,11 +23,16 @@ pub(crate) fn tree(text: &str) -> mdast::Node {
markdown::to_mdast(text, &options()).expect("markdown without MDX always parses")
}
/// A whole file as a syntax tree: front matter too.
pub(crate) fn file_tree(text: &str) -> mdast::Node {
/// How a whole file parses: front matter too.
pub fn file_options() -> ParseOptions {
let mut options = options();
options.constructs.frontmatter = true;
markdown::to_mdast(text, &options).expect("markdown without MDX always parses")
options
}
/// A whole file as a syntax tree.
pub(crate) fn file_tree(text: &str) -> mdast::Node {
markdown::to_mdast(text, &file_options()).expect("markdown without MDX always parses")
}
/// The bytes of the source a parsed node spans.
+1
View File
@@ -44,6 +44,7 @@ pub(crate) use history::Change;
pub use history::{PageHistoryDiff, Version, VersionHistory};
pub use knowledge::{Backlink, Backlinks, Favorite, Favorites, TrashBin, Trashed};
pub use link::LinkEditor;
pub use markdown::file_options as markdown_options;
pub use markdown::markdown_highlights;
pub use modes::{MarkdownEditor, MarkdownMode};
pub use pages::{PageCover, PageIcon};