Skip to content

fix: reject info-string lines as code-fence closers#74

Merged
dacharyc merged 1 commit into
agent-ecosystem:mainfrom
icyJoseph:fix/fence-closer-no-info-string
Apr 30, 2026
Merged

fix: reject info-string lines as code-fence closers#74
dacharyc merged 1 commit into
agent-ecosystem:mainfrom
icyJoseph:fix/fence-closer-no-info-string

Conversation

@icyJoseph
Copy link
Copy Markdown
Contributor

The markdown-code-fence-validity accepts any matching number of ``` backticks as a valid terminator for a fence.

That is a problem for this kind of fenced content:

```
content
``` filename="foo.rs"
```

The current parser ends the block at the ```filename="foo.rs" - but that's not following spec. See what Github renders:

content
``` filename="foo.rs"

One block. Another example, similar to the unit test - though the unit test uses 4 backticks.

In GitHub-flavored markdown you can attach attributes to a fence:
```md filename="example.md"
The closing fence matches the opening fence length, with no info.

Copy link
Copy Markdown
Member

@dacharyc dacharyc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another good catch - thanks for the PR, @icyJoseph !

@dacharyc dacharyc merged commit ea28543 into agent-ecosystem:main Apr 30, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants