Skip to content

fix(links): support spaces in #include file paths#3106

Open
leno23 wants to merge 1 commit into
rust-lang:masterfrom
leno23:fix/include-path-with-spaces-2812
Open

fix(links): support spaces in #include file paths#3106
leno23 wants to merge 1 commit into
rust-lang:masterfrom
leno23:fix/include-path-with-spaces-2812

Conversation

@leno23
Copy link
Copy Markdown

@leno23 leno23 commented May 17, 2026

Summary

{{#include}} and {{#rustdoc_include}} now use the full captured path instead of splitting on whitespace, so file names and paths may contain spaces (e.g. {{#include fila a.md}}). Line ranges still work ({{#include fila a.md:1:2}}).

Playground links are unchanged and still use whitespace-separated path and properties.

Fixes #2812.

Test plan

  • Unit tests in links.rs for paths with spaces (with and without line ranges)
  • Extended includes/all_includes testsuite case
  • CI

Made with Cursor

Parse the full include target from the link capture instead of splitting
on whitespace, so paths like `fila a.md` work. Playground links still use
whitespace-separated path and properties.

Fixes rust-lang#2812.

Co-authored-by: Cursor <cursoragent@cursor.com>
@rustbot rustbot added the S-waiting-on-review Status: waiting on a review label May 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: waiting on a review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

#include fails with a space in the file name

2 participants