feat: parse header id #65#66
Merged
AndrewSouthpaw merged 7 commits intothlorenz:masterfrom Apr 19, 2026
Merged
Conversation
Contributor
Author
|
@AndrewSouthpaw can you take a look and once merged release as 0.9. |
AndrewSouthpaw
requested changes
Apr 18, 2026
Collaborator
AndrewSouthpaw
left a comment
There was a problem hiding this comment.
There's a bunch of cases missed by this implementation:
| Test | Expected | Actual |
|---|---|---|
Standard {#head} |
[Heading Text](#head) |
[Heading Text](#hea) |
Unclosed {#foo |
[Heading {#foo](#heading-foo) |
[Heading](#f) |
| Trailing text | [Heading {#foo} trailing](#heading-foo-trailing) |
[Heading](#foo%7D%20traili) |
Mid-text {#hashes} |
[Set of {#hashes} in prose](#set-of-hashes-in-prose) |
[Set of](#hashes%7D%20in%20pro) |
I'm going to add a set of tests and a proposed fix...
Covers: standard single-brace {#id}, unclosed {#, trailing text after
{#id}, and literal {# mid-text. All four fail against the current
split/slice implementation.
121eb8c to
4ffd6b8
Compare
Replaces split/slice with a single end-of-line anchored regex that
requires a balanced {#id}. Unclosed braces, trailing text, and mid-text
{# are now left as literal header text.
Drops the non-standard {:id:} syntax — kramdown's actual IAL syntax is
{: #id}, not {:id:}, so the PR as written didn't match any real flavor.
Collaborator
|
Opened a fix here: thompson-tomo#8 |
Contributor
Author
|
Thanks for your assistance/input with this @AndrewSouthpaw |
AndrewSouthpaw
approved these changes
Apr 19, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes: #65
This pulls out the header id from the text.