Skip to content

fix: hyphenate each space in integration README heading slugs - #5735

Closed
dimitrieh wants to merge 1 commit into
mainfrom
fix/integration-readme-anchor-slugs
Closed

fix: hyphenate each space in integration README heading slugs#5735
dimitrieh wants to merge 1 commit into
mainfrom
fix/integration-readme-anchor-slugs

Conversation

@dimitrieh

Copy link
Copy Markdown
Contributor

Description

The link checker is failing on main with one bad anchor, /integrations/node-red-contrib-counter#bugs--feature-request. githubSlugify collapsed runs of whitespace into a single hyphen; GitHub strips the punctuation first and then hyphenates the remaining spaces one at a time, so a heading with punctuation between two words keeps the space on either side and lands a double hyphen. That README's Bugs / Feature request is #bugs--feature-request on GitHub and its own table of contents links to it, while we generated #bugs-feature-request.

One character, \s+ to \s. It fixes every table-of-contents link a README author wrote against GitHub for a heading with punctuation in it, not just this one. Headings whose words are separated by single spaces slug identically either way, which is why one anchor broke rather than hundreds; the function's own documented example, #egm-optional for "EGM (optional)", is unchanged.

Checked all nine of that README's anchors against the ten headings it declares: one dangling before, none after.

Related Issue(s)

Found while working on #5671, which is blocked by this failure.

Checklist

  • I have read the contribution guidelines
  • I have considered the performance impact of these changes
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
  • For blog PRs, an Art Request has been created (instructions)

githubSlugify is private to a .ts util and npm test only globs .mjs libs, so there is nowhere to unit test it without restructuring. The checker's own --check-anchors pass over the built integration pages is the regression guard.

githubSlugify collapsed runs of whitespace into a single hyphen. GitHub strips the
punctuation first and then hyphenates the remaining spaces one at a time, so a
heading with punctuation between two words keeps the space on either side of it and
lands a double hyphen. node-red-contrib-counter's "Bugs / Feature request" is
#bugs--feature-request on GitHub, its own table of contents links to that, and we
generated #bugs-feature-request, so the link pointed at an id that did not exist.

That is the bad anchor failing the link checker on main, and with it every
table-of-contents entry a README author wrote against GitHub for a heading with
punctuation in it. Headings whose words are separated by single spaces slug
identically either way, which is why one anchor broke rather than hundreds.

The checker's own --check-anchors run over the built integration pages is the
regression guard; githubSlugify is private to a .ts util and the test script only
globs .mjs libs, so there is nowhere to unit test it without restructuring.
@dimitrieh

Copy link
Copy Markdown
Contributor Author

@Yndira-E this is because of a CI failure. maybe this PR is not needed and the link needs to be just updated 🤔

@Yndira-E

Yndira-E commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

I know, I had opened a similar one, could you please review/merge that one? #5734

@Yndira-E Yndira-E closed this Sep 2, 2026
@netlify

netlify Bot commented Sep 2, 2026

Copy link
Copy Markdown

Deploy Preview for flowforge-website ready!

Name Link
🔨 Latest commit 03bd434
🔍 Latest deploy log https://app.netlify.com/projects/flowforge-website/deploys/6a985efecab46f000800d6f7
😎 Deploy Preview https://deploy-preview-5735--flowforge-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 68 (🟢 up 18 from production)
Accessibility: 96 (no change from production)
Best Practices: 100 (no change from production)
SEO: 85 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

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