Skip to content

fix: strip unused link reference definitions in legacy path - #1066

Open
Hashim1999164 wants to merge 1 commit into
showdownjs:masterfrom
Hashim1999164:fix/1061-unused-link-definitions
Open

Hashim1999164 wants to merge 1 commit into
showdownjs:masterfrom
Hashim1999164:fix/1061-unused-link-definitions

Conversation

@Hashim1999164

@Hashim1999164 Hashim1999164 commented Jul 22, 2026 •

Copy link
Copy Markdown

Summary

  • Unused link reference definitions leaked into HTML for legacy (non-cmSpec) flavors because stripLinkDefinitions required the link id to appear at least twice.
  • Remove that occurrence-count check so definitions are always stripped, matching Markdown.pl / CommonMark behavior.
  • Add a regression fixture under test/functional/makehtml/cases/issues/.

Fixes #1061

Test plan

  • vitest run test/functional/makehtml/ (1966 tests passed)
  • Manual check: new Converter().makeHtml('[unused]: http://example.com/') returns ""
  • Manual check: impostor case [x]: take out the garbage still preserved as paragraph text

Remove the occurrence-count heuristic that left unused [id]: url
definitions in the HTML output for non-cmSpec flavors.

Fixes showdownjs#1061
@Hashim1999164
Hashim1999164 force-pushed the fix/1061-unused-link-definitions branch from b08bf58 to 6a192a6 Compare August 28, 2026 18:27

This branch has not been deployed

No deployments
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.

Unused link reference definitions leak into the output (legacy path)

1 participant