Skip to content

Conversation

@kemingy
Copy link
Contributor

@kemingy kemingy commented Nov 30, 2025

As discussed in #1729 (comment)

Signed-off-by: Keming <kemingy94@gmail.com>
Signed-off-by: Keming <kemingy94@gmail.com>
Copilot AI review requested due to automatic review settings December 4, 2025 13:33
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new quirk to handle GitHub markdown blob URLs with fragments by converting them to raw GitHub URLs. This enables proper fragment checking by allowing lychee to parse the raw markdown content instead of the rendered HTML. The implementation updates the quirks system to pass regex captures to rewrite functions, enabling pattern-based URL transformations.

Key Changes:

  • Updated quirk rewrite function signature to accept Captures parameter for pattern-based URL transformations
  • Added new GITHUB_BLOB_MARKDOWN_FRAGMENT_PATTERN to match GitHub blob URLs with markdown fragments
  • Implemented URL rewrite logic to convert GitHub blob URLs to raw.githubusercontent.com URLs

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Keming <kemingy94@gmail.com>
@thomas-zahner
Copy link
Member

@mre @kemingy Why is copilot starting to comment on this PR? 😩 I really hate this. For example it lies/hallucinates about things and provides an unnecessary summary that is bigger than the diff..

Can we disable it globally for the whole organisation? I thought we already did 😅

Signed-off-by: Keming <kemingy94@gmail.com>
@kemingy
Copy link
Contributor Author

kemingy commented Dec 4, 2025

@mre @kemingy Why is copilot starting to comment on this PR? 😩 I really hate this. For example it lies/hallucinates about things and provides an unnecessary summary that is bigger than the diff..

Can we disable it globally for the whole organisation? I thought we already did 😅

I'm not sure why Copilot AI review requested due to automatic review settings after pushing another commit. But opening this PR doesn't trigger that.

From what I know, this can be configured in the ruleset of repo settings.

pattern: &GITHUB_BLOB_MARKDOWN_FRAGMENT_PATTERN,
rewrite: |mut request, captures| {
let mut raw_url = String::new();
captures.expand(
Copy link
Member

Choose a reason for hiding this comment

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

That's a great solution 🚀

@thomas-zahner thomas-zahner merged commit 072970d into lycheeverse:master Dec 5, 2025
7 checks passed
@kemingy kemingy deleted the github_quirk branch December 5, 2025 10:23
This was referenced Dec 5, 2025
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