Repository navigation
fix: keep text after an unclosed { and documents with broken frontmatter
#570
New issue
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
Merged
farnabaz
merged 5 commits into
comarkdown:main
from
onmax:fix/525-attributes-frontmatter
Nov 19, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3a7e0a5
fix(attributes): keep an unclosed brace group as text
onmax 2ac844f
fix(frontmatter): close only on a bare `---` line and report invalid …
onmax 82a83de
Merge branch 'main' into fix/525-attributes-frontmatter
farnabaz 09b792b
refactor(frontmatter): let parseFrontmatter throw and handle invalid …
farnabaz e03c07c
fix(auto-close): recognize frontmatter opener after a byte order mark
farnabaz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
77 changes: 77 additions & 0 deletions
77
packages/comark/SPEC/COMARK/attributes/paragraph-unclosed-brace.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| ## Input | ||
|
|
||
| ```md | ||
| a {b c | ||
|
|
||
| x **y** {b c d | ||
|
|
||
| # Title {.red | ||
|
|
||
| - item {#id | ||
| ``` | ||
|
|
||
| ## AST | ||
|
|
||
| ```json | ||
| { | ||
| "frontmatter": {}, | ||
| "meta": {}, | ||
| "nodes": [ | ||
| [ | ||
| "p", | ||
| {}, | ||
| "a {b c" | ||
| ], | ||
| [ | ||
| "p", | ||
| {}, | ||
| "x ", | ||
| [ | ||
| "strong", | ||
| {}, | ||
| "y" | ||
| ], | ||
| " {b c d" | ||
| ], | ||
| [ | ||
| "h1", | ||
| { | ||
| "id": "title-red" | ||
| }, | ||
| "Title {.red" | ||
| ], | ||
| [ | ||
| "ul", | ||
| {}, | ||
| [ | ||
| "li", | ||
| {}, | ||
| "item {#id" | ||
| ] | ||
| ] | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| ## HTML | ||
|
|
||
| ```html | ||
| <p>a {b c</p> | ||
| <p>x <strong>y</strong> {b c d</p> | ||
| <h1 id="title-red">Title {.red</h1> | ||
| <ul> | ||
| <li>item {#id</li> | ||
| </ul> | ||
| ``` | ||
|
|
||
| ## Markdown | ||
|
|
||
| ```md | ||
| a \{b c | ||
|
|
||
| x **y** \{b c d | ||
|
|
||
| # Title \{.red | ||
|
|
||
| - item \{#id | ||
| ``` |
38 changes: 38 additions & 0 deletions
38
packages/comark/SPEC/COMARK/frontmatter-closing-delimiter-with-text.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| ## Input | ||
|
|
||
| ```md | ||
| --- | ||
| title: a | ||
| --- x | ||
| --- | ||
|
|
||
| Body | ||
| ``` | ||
|
|
||
| ## AST | ||
|
|
||
| ```json | ||
| { | ||
| "frontmatter": {}, | ||
| "meta": {}, | ||
| "nodes": [ | ||
| [ | ||
| "p", | ||
| {}, | ||
| "Body" | ||
| ] | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| ## HTML | ||
|
|
||
| ```html | ||
| <p>Body</p> | ||
| ``` | ||
|
|
||
| ## Markdown | ||
|
|
||
| ```md | ||
| Body | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| ## Input | ||
|
|
||
| ```md | ||
| --- | ||
| title: [ | ||
| --- | ||
|
|
||
| # Hi | ||
| ``` | ||
|
|
||
| ## AST | ||
|
|
||
| ```json | ||
| { | ||
| "frontmatter": {}, | ||
| "meta": {}, | ||
| "nodes": [ | ||
| [ | ||
| "h1", | ||
| { | ||
| "id": "hi" | ||
| }, | ||
| "Hi" | ||
| ] | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| ## HTML | ||
|
|
||
| ```html | ||
| <h1 id="hi">Hi</h1> | ||
| ``` | ||
|
|
||
| ## Markdown | ||
|
|
||
| ```md | ||
| # Hi | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.