Skip to content

Avoid wrapping Markdown Javadoc lines before OpenJDK summary breaks. - #1550

Merged
copybara-service[bot] merged 1 commit into
masterfrom
test_1031222248
Nov 28, 2026
Merged

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

Conversation

@copybara-service

Copy link
Copy Markdown

Avoid wrapping Markdown Javadoc lines before OpenJDK summary breaks.

When wrapping a /// Markdown Javadoc line, breaking before a token starting with -, +, *, #, =, _, or (inside <...>, [...], (...), or `...`) . places that character at the start of the continuation line. OpenJDK's DocTreeMaker.SentenceBreaker runs normalizeMarkdown (replacing . with - inside those delimiters) and matches endPara (\n(([ \t]*\n)|( {0,3}[-+*#=_>]))) before CommonMark parsing, truncating method, type, and @deprecated summaries at the line break and leaving unclosed code spans when the break falls inside `...`.

Extend JavadocLexer.couldStartMarkdownBlockOrEndParagraph to pin any whitespace-preceded token starting with -, +, *, #, =, _, >, or . onto the preceding literal or footer tag in Markdown Javadoc, which also subsumes the CommonMark bullet, heading, thematic-break, and --prefixed table-separator patterns previously matched via regex.

When wrapping a `///` Markdown Javadoc line, breaking before a token starting with `-`, `+`, `*`, `#`, `=`, `_`, or (inside `<...>`, `[...]`, `(...)`, or `` `...` ``) `.` places that character at the start of the continuation line. OpenJDK's `DocTreeMaker.SentenceBreaker` runs `normalizeMarkdown` (replacing `.` with `-` inside those delimiters) and matches `endPara` (`\n(([ \t]*\n)|( {0,3}[-+*#=_>]))`) before CommonMark parsing, truncating method, type, and `@deprecated` summaries at the line break and leaving unclosed code spans when the break falls inside `` `...` ``.

Extend `JavadocLexer.couldStartMarkdownBlockOrEndParagraph` to pin any whitespace-preceded token starting with `-`, `+`, `*`, `#`, `=`, `_`, `>`, or `.` onto the preceding literal or footer tag in Markdown Javadoc, which also subsumes the CommonMark bullet, heading, thematic-break, and `-`-prefixed table-separator patterns previously matched via regex.

PiperOrigin-RevId: 1031827932
@copybara-service
copybara-service Bot merged commit cbc7a8f into master Nov 28, 2026
12 checks passed
@copybara-service
copybara-service Bot deleted the test_1031222248 branch November 28, 2026 21:46
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