Skip to content

Treat .qmd and .Rmd files as Markdown#2172

Merged
mre merged 5 commits into
masterfrom
treat-qmd-rmd-as-markdown
May 30, 2026
Merged

Treat .qmd and .Rmd files as Markdown#2172
mre merged 5 commits into
masterfrom
treat-qmd-rmd-as-markdown

Conversation

@mre

@mre mre commented Apr 25, 2026

Copy link
Copy Markdown
Member

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

mre added 3 commits April 25, 2026 16:56
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.
@mre mre force-pushed the treat-qmd-rmd-as-markdown branch from b3b5331 to 4b57d5e Compare April 25, 2026 15:05

@katrinafyi katrinafyi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Comment thread lychee-lib/src/types/file.rs Outdated
@katrinafyi

Copy link
Copy Markdown
Member

I've made a commit at treat-qmd-rmd-as-markdown...rina-forks:lychee:treat-qmd-rmd-as-markdown to fix up the iterator.

katrinafyi and others added 2 commits May 30, 2026 16:28
Now that FileExtensions iterates forward (via IntoIterator) instead of
popping from the end, store MARKDOWN_EXTENSIONS and HTML_EXTENSIONS in
their documented popularity order and drop the obsolete reverse-order
note. This keeps default_extensions() output consistent with the
documented default.
@mre

mre commented May 30, 2026

Copy link
Copy Markdown
Member Author

Thanks, @katrinafyi, I've cherry-picked your commit into the branch. Looks fine to me. 😊
I also dropped the obsolete "stored in reverse-popularity order because the iterator pops from the end" comment.
One more thing that I noticed was that the README still contained the old ordering. I updated that.

@mre mre requested a review from katrinafyi May 30, 2026 14:37

@katrinafyi katrinafyi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good!

@mre mre merged commit 5e9366f into master May 30, 2026
8 checks passed
@mre mre deleted the treat-qmd-rmd-as-markdown branch May 30, 2026 22:17
@mre

mre commented May 30, 2026

Copy link
Copy Markdown
Member Author

Thanks for the support.

@mre mre mentioned this pull request May 30, 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.

Treat .qmd/ .Rmd as markdown

2 participants