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