Skip to content

ci: escape regex metacharacters in baseline links for .lycheeignore#744

Merged
f-hollow merged 1 commit into
espressif:mainfrom
DatanoiseTV:ci/escape-lycheeignore-baseline
Jun 12, 2026
Merged

ci: escape regex metacharacters in baseline links for .lycheeignore#744
f-hollow merged 1 commit into
espressif:mainfrom
DatanoiseTV:ci/escape-lycheeignore-baseline

Conversation

@DatanoiseTV

Copy link
Copy Markdown
Contributor

Description

The pr-check-links workers append the baseline link dump verbatim to .lycheeignore, whose lines lychee parses as regexes. Any baseline URL containing regex metacharacters aborts the whole check with a parse error before a single link is verified.

This is live on main today: the provisioning QR-code URL in content/blog/2026/05/simple-provisioning/ (qrcode.html?data={%22ver%22...}) contains {...}, which lychee rejects as an invalid repetition quantifier:

Error: regex parse error:
    https://espressif.github.io/esp-jumpstart/qrcode.html?data={%22ver%22,...}
error: repetition quantifier expects a valid decimal

As a result, every PR whose diff touches the blog_0-9a-f bucket currently fails check-links regardless of its own links (seen on #742, where blog_0-9a-f fails and blog_g-z passes).

The fix escapes regex metacharacters in the baseline dump before appending, so baseline URLs match literally.

Related

Testing

Verified the sed transform on the offending URL:

$ echo 'https://espressif.github.io/esp-jumpstart/qrcode.html?data={%22ver%22:%22v1%22}' | sed 's/[][\.^$*+?(){}|]/\\&/g'
https://espressif\.github\.io/esp-jumpstart/qrcode\.html\?data=\{%22ver%22:%22v1%22\}

which is a valid regex matching the URL literally.

Baseline links are appended verbatim to .lycheeignore, whose lines
lychee parses as regexes. A baseline URL containing regex
metacharacters aborts the whole check with a parse error before any
link is verified — currently triggered by the provisioning QR-code URL
(`qrcode.html?data={%22ver%22...}`) in content/blog/2026/05/
simple-provisioning, which fails the blog_0-9a-f bucket for every PR.

Escape the metacharacters so baseline URLs match literally.
@pedrominatel

Copy link
Copy Markdown
Member

@f-hollow, PTAL.

@f-hollow f-hollow left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DatanoiseTV

I tested your changes. Now the issue of broken links reported from non-PR changes is gone!

Thank you very much for digging into it!

LGTM!

@f-hollow f-hollow merged commit 1e2706a into espressif:main Jun 12, 2026
4 checks passed
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.

3 participants