documents: the whole-file parse options are public, for export
This commit is contained in:
2 files changed
+9
-3
No files matched your search
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user