Open
Conversation
Quarto (.qmd) and R Markdown (.Rmd) are popular Markdown variants. Previously they fell through to the plaintext parser, causing URLs inside fenced code blocks to be extracted as links (e.g. shell substitutions like $(arch) producing surprising failures). Closes #2157
md and markdown come first, followed by mdx, qmd, rmd, then the long tail of legacy extensions.
b3b5331 to
4b57d5e
Compare
katrinafyi
reviewed
Apr 29, 2026
Member
katrinafyi
left a comment
There was a problem hiding this comment.
The functional change set is fine but this comment and its implications are eyebrow raising. It doesn't need to be fixed in this PR, but also might as well.
| impl FileType { | ||
| /// All known Markdown extensions | ||
| // NOTE: Stored in reverse-popularity order because the `Iterator` impl for | ||
| // `FileExtensions` pops from the end |
Member
There was a problem hiding this comment.
This comment really makes me raise an eyebrow at impl Iterator for FileExtensions. Conceptually, I do not think FileExtensions should be a stateful iterator that gets mutated.
Is iterating over FileExtensions even necessary? If iteration is needed, it should delegate to Vec's iterator, or there can just be a function that returns a slice of strings.
Member
Author
There was a problem hiding this comment.
Yeah, true, that crossed my mind as well. Didn't want to change too much at once, but I could change that in this PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Quarto (.qmd) and R Markdown (.Rmd) are popular Markdown variants. Lychee was parsing them as plaintext, so URLs inside fenced code blocks were extracted as links, including ones with shell substitutions like $(arch) that fail link checks.
This adds qmd and rmd to the list of Markdown extensions. Case-insensitive lookup already handles .Rmd.
Includes fixtures reproducing the example from the issue and CLI tests confirming that real links are extracted while code-block URLs are skipped by default.
Closes #2157