Skip to content

fix: parse markdown custom type links into href values - #539

Open
theworker02 wants to merge 1 commit into
all-contributors:mainfrom
theworker02:fix/markdown-link-href
Open

theworker02 wants to merge 1 commit into
all-contributors:mainfrom
theworker02:fix/markdown-link-href

Conversation

@theworker02

Copy link
Copy Markdown

Summary

When custom contribution types.*.link values use the documented markdown form ([<%= symbol %>](https://…)), the rendered badge previously put that whole string into href.

This extracts the markdown URL into href (and the bracket text into the anchor label), while keeping plain URL templates working as before.

Test plan

Fixes #520

Custom contribution types documented as markdown badges
(`[symbol](url)`) were injected wholesale into the HTML `href`. Extract
the URL (and optional label) so anchors render correctly.

Fixes all-contributors#520.

Co-authored-by: Cursor <cursoragent@cursor.com>
@matbrgz

matbrgz commented Sep 27, 2026

Copy link
Copy Markdown

Review from Matheus Breguêz (@matbrgz):

Nice catch on issue #520, @theworker02!

Extracting the target URL from the markdown syntax [<%= symbol %>](url) when configured under custom types.*.link correctly prevents emitting malformed href="[...](...)" HTML attributes in the table. The regex extraction and fallback behavior in resolveContributionLink handle both markdown formats and bare URL templates cleanly.

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.

[BUG]: Markdown provided in types[key].link is injected as-is into HTMLAnchorElement's href attribute

2 participants