Skip to content

Avoid wrapping Markdown Javadoc lines before CommonMark block markers. - #1543

Merged
copybara-service[bot] merged 1 commit into
masterfrom
test_1028177209
Nov 26, 2026
Merged

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

Conversation

@copybara-service

Copy link
Copy Markdown

Avoid wrapping Markdown Javadoc lines before CommonMark block markers.

When wrapping a /// Markdown Javadoc line, breaking before a CommonMark block marker places that marker at the start of the continuation line. CommonMark then parses the continuation line as a list, block quote, heading, thematic break, fenced code block, table separator, or HTML block, changing the rendered documentation and splitting inline code spans across blocks.

Split literal and whitespace coalescing in JavadocLexer into two passes so cross-whitespace joining inspects complete tokens, then pin whitespace-preceded Markdown block-marker literals onto the preceding literal (matching existing @ handling). Also emit <code> and </code> as literals in Markdown Javadoc so markers following </code> are pinned, and set somethingSinceNewline inside Markdown code spans so > inside a code span within a block quote is not consumed as a block quote marker on reformatting.

When wrapping a `///` Markdown Javadoc line, breaking before a CommonMark block marker places that marker at the start of the continuation line. CommonMark then parses the continuation line as a list, block quote, heading, thematic break, fenced code block, table separator, or HTML block, changing the rendered documentation and splitting inline code spans across blocks.

Split literal and whitespace coalescing in `JavadocLexer` into two passes so cross-whitespace joining inspects complete tokens, then pin whitespace-preceded Markdown block-marker literals onto the preceding literal (matching existing `@` handling). Also emit `<code>` and `</code>` as literals in Markdown Javadoc so markers following `</code>` are pinned, and set `somethingSinceNewline` inside Markdown code spans so `>` inside a code span within a block quote is not consumed as a block quote marker on reformatting.

PiperOrigin-RevId: 1030547522
@copybara-service
copybara-service Bot merged commit eb7c2c3 into master Nov 26, 2026
4 checks passed
@copybara-service
copybara-service Bot deleted the test_1028177209 branch November 26, 2026 10:35
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