Skip to content

Include indent fixes#3080

Open
Omnikron13 wants to merge 28 commits intorust-lang:masterfrom
Omnikron13:trim-indent
Open

Include indent fixes#3080
Omnikron13 wants to merge 28 commits intorust-lang:masterfrom
Omnikron13:trim-indent

Conversation

@Omnikron13
Copy link
Copy Markdown

@Omnikron13 Omnikron13 commented Apr 27, 2026

Should fix issues #1626, #1564, #2830, #2521, #1127, #619, #1601.

Would supersede PRs #1718, #2831, #1565, and I think the majority of uses for #1856 & #2333.

There is an open question of what exactly to do with non-whitespace before a link, e.g. foo{{#include ...}}

@Omnikron13
Copy link
Copy Markdown
Author

The relevant documentation doesn't need any changes to reflect these changes, though would need an addition if the new behaviour is considered non-obvious.

As a side note I ran into unit tests which cover undocumented behaviour while working on this. Anchored includes in the following form aren't covered atm:

// ANCHOR: name
println!("included");
// ANCHOR_END: name
println!("not included");
// ANCHOR: name
println!("included");
// ANCHOR_END: name

(As an additional detail, there were only actually unit tests for this for the rustdoc_include variant, but I have expanded the testing to cover the include version too.)

@Omnikron13

This comment was marked as outdated.

@Omnikron13

This comment was marked as outdated.

@Omnikron13
Copy link
Copy Markdown
Author

Note: some of the issues this would fix do so relying on the fact that anything before the include link will be repeated as a prefix (because they are people wanting to use include within block quotes).

@Omnikron13 Omnikron13 marked this pull request as ready for review April 30, 2026 21:32
@rustbot rustbot added the S-waiting-on-review Status: waiting on a review label Apr 30, 2026
@Omnikron13

This comment was marked as outdated.

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.

2 participants