Skip to content

Preserve relative indentation in <pre>{@code ...} blocks lacking leading *. - #1476

Merged
copybara-service[bot] merged 1 commit into
masterfrom
test_993625345
Oct 6, 2026
Merged

copybara-service[bot] merged 1 commit into
masterfrom
test_993625345

Conversation

@copybara-service

Copy link
Copy Markdown

Preserve relative indentation in <pre>{@code ...} blocks lacking leading *.

In classic Javadoc, lines inside <pre> blocks that omit the * margin prefix
previously had all leading whitespace stripped via line.stripLeading(),
destroying relative indentation in code samples.

Instead, strip only up to the comment's base indentation column so that
JavadocLexer.deindentPreCodeBlocks can preserve the relative indentation of
the sample.

…ading `*`.

In classic Javadoc, lines inside `<pre>` blocks that omit the `*` margin prefix
previously had all leading whitespace stripped via `line.stripLeading()`,
destroying relative indentation in code samples.

Instead, strip only up to the comment's base indentation column so that
`JavadocLexer.deindentPreCodeBlocks` can preserve the relative indentation of
the sample.

PiperOrigin-RevId: 994305827
@copybara-service
copybara-service Bot merged commit 1f9d2ac into master Oct 6, 2026
12 checks passed
@copybara-service
copybara-service Bot deleted the test_993625345 branch October 6, 2026 11:26
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.

1 participant