Skip to content

fix: add in special character tests#300

Merged
AndrewSouthpaw merged 7 commits intothlorenz:masterfrom
thompson-tomo:special_characters
Feb 10, 2026
Merged

fix: add in special character tests#300
AndrewSouthpaw merged 7 commits intothlorenz:masterfrom
thompson-tomo:special_characters

Conversation

@thompson-tomo
Copy link
Contributor

@thompson-tomo thompson-tomo commented Dec 14, 2025

This ensures that special characters are being correctly handled and producing the expected results. The examples from the below issues have been added to a markdown file and a test added to compared it to the link generated by the github website.

Closes: #79
Closes: #92
Closes: #96
Closes: #97
Closes: #122
Closes: #138
Closes: #165
Closes: #172
Closes: #175
Closes: #182
Closes: #193
Closes: #223
Closes: #242
Closes: #260

Blocked by: thlorenz/anchor-markdown-header#52 & thlorenz/anchor-markdown-header#53

Note the update for above also
Closes: #167

@thompson-tomo
Copy link
Contributor Author

Am just awaiting a release of anchor-markdown-header which will resolve test failures.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds regression coverage to ensure TOC anchor generation behaves correctly with a wide range of special characters (based on multiple historical issues) and updates an existing expectation for CRLF-related escaping.

Changes:

  • Updated the CRLF fixture expectation to no longer percent-encode backslashes in the generated anchor.
  • Added a new markdown fixture containing many “special character” headings from prior issues.
  • Added a new test asserting the generated TOC output for that fixture.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
test/transform.js Updates expected anchor output for the CRLF test case.
test/transform-weird-headers.js Adds a new regression test covering many special-character headings.
test/fixtures/readme-with-special-characters.md New fixture markdown containing headings with special characters to validate anchor behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@thompson-tomo
Copy link
Contributor Author

Unfortunately i removed the wrong special character in the anchor generator. :( Hence have fixed this via thlorenz/anchor-markdown-header#61

Updated integrity hash for anchor-markdown-header package.
@thompson-tomo
Copy link
Contributor Author

@AndrewSouthpaw could you review this pr along with #305 which will do a big cleanup and resolve a number of issues. 🙂 Followed by #303 & #307 after which we should trigger a release.

@AndrewSouthpaw AndrewSouthpaw merged commit 819e747 into thlorenz:master Feb 10, 2026
5 checks passed
@thompson-tomo thompson-tomo deleted the special_characters branch February 10, 2026 23:06
@jrfnl
Copy link

jrfnl commented Feb 12, 2026

Thank you for working on this ! I look forward to seeing the fix in the next release 💞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment