We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It seems that markdown with only front matter without a newline at the end may not be parsed correctly.
source:
let text = "--- foo: bar ---"; let arena = Arena::new(); let mut options = Options::default(); options.extension.front_matter_delimiter = Some("---".to_owned()); let ast = parse_document(&arena, text, &options); println!("{:?}", ast);
output:
Node { data: RefCell { value: Ast { value: Document, sourcepos: Sourcepos { start: LineColumn { line: 1, column: 1 }, end: LineColumn { line: 3, column: 3 } }, internal_offset: 0, content: "", open: false, last_line_blank: false, table_visited: false, line_offsets: [] } }, children: [ Node { data: RefCell { value: Ast { value: ThematicBreak, sourcepos: Sourcepos { start: LineColumn { line: 1, column: 1 }, end: LineColumn { line: 1, column: 3 } }, internal_offset: 0, content: "", open: false, last_line_blank: false, table_visited: false, line_offsets: [] } }, children: [] }, Node { data: RefCell { value: Ast { value: Heading(NodeHeading { level: 2, setext: true }), sourcepos: Sourcepos { start: LineColumn { line: 2, column: 1 }, end: LineColumn { line: 3, column: 3 } }, internal_offset: 0, content: "foo: bar\n", open: false, last_line_blank: false, table_visited: false, line_offsets: [0] } }, children: [Node { data: RefCell { value: Ast { value: Text("foo: bar"), sourcepos: Sourcepos { start: LineColumn { line: 2, column: 1 }, end: LineColumn { line: 2, column: 8 } }, internal_offset: 0, content: "", open: false, last_line_blank: false, table_visited: false, line_offsets: [] } }, children: [] }] } ] }
let text = "--- foo: bar --- "; let arena = Arena::new(); let mut options = Options::default(); options.extension.front_matter_delimiter = Some("---".to_owned()); let ast = parse_document(&arena, text, &options); println!("{:?}", ast);
Node { data: RefCell { value: Ast { value: Document, sourcepos: Sourcepos { start: LineColumn { line: 1, column: 1 }, end: LineColumn { line: 0, column: 0 } }, internal_offset: 0, content: "", open: false, last_line_blank: false, table_visited: false, line_offsets: [] } }, children: [ Node { data: RefCell { value: Ast { value: FrontMatter("---\nfoo: bar\n---\n"), sourcepos: Sourcepos { start: LineColumn { line: 0, column: 1 }, end: LineColumn { line: 0, column: 0 } }, internal_offset: 0, content: "", open: false, last_line_blank: false, table_visited: false, line_offsets: [] } }, children: [] } ] }
Thanks for a great library ❤️
The text was updated successfully, but these errors were encountered:
This is an interesting corner case — I don't see why we shouldn't handle this correctly. Thanks for the report!
Sorry, something went wrong.
failing test for #504
8848a96
charlottia
Successfully merging a pull request may close this issue.
It seems that markdown with only front matter without a newline at the end may not be parsed correctly.
Incorrect case
source:
output:
Correct case
source:
output:
Environment
Thanks for a great library ❤️
The text was updated successfully, but these errors were encountered: