Skip to content

fix: include angle brackets in URL validation regex#1113

Closed
razor-x wants to merge 1 commit into
mainfrom
claude/fix-broken-docs-links-xdaov
Closed

fix: include angle brackets in URL validation regex#1113
razor-x wants to merge 1 commit into
mainfrom
claude/fix-broken-docs-links-xdaov

Conversation

@razor-x

@razor-x razor-x commented May 20, 2026

Copy link
Copy Markdown
Member

Summary

Updated the URL validation regex in the link validator to exclude angle brackets (< and >) from valid URL characters, preventing malformed URLs from being incorrectly validated.

Changes

  • Modified the absoluteUrlPattern regex in codegen/validate-links.ts to add <> to the character exclusion set
  • This prevents URLs that contain angle brackets from being matched, which can occur in HTML or markdown contexts where URLs are accidentally wrapped in angle brackets

Implementation Details

The regex pattern now excludes <> characters alongside the existing exclusions for quotes, backslashes, and whitespace: [^)"<>\\s]+

This ensures the link validator correctly identifies and reports malformed URLs that may contain these characters.

https://claude.ai/code/session_01DZTR4oU9UvQMWa3A9XEXLR

The bare absolute-URL regex stopped only at whitespace, `)`, and `"`. When
a `docs.seam.co/latest/...` URL appeared as anchor text inside HTML
(e.g. `>https://docs.seam.co/latest/foo</a></td>`), the match greedily
swallowed the trailing tags and reported the malformed path as broken.

Adding `<` and `>` to the exclusion set lets the bare URL pattern
terminate at the closing `<`, so cross-section absolute URLs in the
guides README validate cleanly.
@razor-x razor-x closed this May 20, 2026
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