Repository navigation
fix(readme): TOC anchors had a leading hyphen, so none of them resolved - #13
Conversation
GitHub strips a heading's emoji AND the whitespace before it, so '## 📏 Виміряно' anchors to #виміряно. Every TOC link carried a leading hyphen from the earlier fix, which looks plausible in a diff and 404s in the browser. Adds tests/readme-toc.test.js with github-slugger's algorithm transcribed: every H2 has a link, no orphans, every anchor equals the real slug, and no leading-hyphen anchors. Verified the test fails (4/6) when the hyphen is put back and passes (6/6) without it.
There was a problem hiding this comment.
🔍 Devin Review: 2 flags
Not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
The README documented 'hermes skill install cavemenko' — a subcommand
that does not exist. Verified end to end instead:
hermes skills install \
"https://raw.githubusercontent.com/ruslanlap/cavemenko/master/skills/cavemenko/SKILL.md" \
--category productivity
Hermes fetches, security-scans (verdict SAFE) and installs it as
productivity/cavemenko, source-tracked as url/community, so
'hermes skills check' and 'hermes skills update' work afterwards.
Docs now cover install / check / update / uninstall, the auto_load step
without which the skill is available but not active, and the offline
copy path.
Tests: no invented 'hermes skill install' anywhere, update+uninstall
documented, auto_load documented, raw URLs on the master branch (the
default branch here is master, not main), and a live HEAD check that
every raw URL returns 200 — a 404 is exactly the failure where the
install command silently finds nothing.
147 tests pass.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 359d826114
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return text | ||
| .toLowerCase() | ||
| .replace(/[^\p{L}\p{N}_\- ]/gu, '') | ||
| .trim() |
There was a problem hiding this comment.
Preserve the leading space in the GitHub slug model
For every H2 that starts with an emoji, github-slugger removes the emoji and then replaces spaces with hyphens; it does not trim the space left behind. Thus 📏 Виміряно becomes -виміряно, not виміряно. This .trim() makes the new test bless the wrong behavior, so the changed README anchors without a leading hyphen do not resolve on GitHub.
Useful? React with 👍 / 👎.
What
None of the TOC links resolved. They all looked plausible in the diff, which is why two earlier passes "fixed" the TOC and left it broken.
Root cause: GitHub strips a heading's emoji and the whitespace before it, so
## 📏 Виміряноanchors to#виміряно— no leading hyphen. Every entry carried one:The
#%EF%B8%8F-конфігураціяpercent-encoded form was also wrong, and the badge link in the header pointed at the broken#-виміряно.The part that matters
Anchors in a README are invisible to tests, so they rot silently.
tests/readme-toc.test.jstranscribes github-slugger's algorithm and asserts:Verified the test actually catches this class of bug: re-adding the hyphen fails 4 of 6 assertions, removing it passes 6 of 6.
141 tests pass.