Skip to content

Asterisk without trailing whitespace in block comment is not stripped #4151

@sgrekhov

Description

@sgrekhov

According to the Dart doc specification

Any whitespace immediately following the asterisk is also stripped, if present.

The phrase “if present” assumes that the whitespace may be absent. In case

/**Text.
 *More text.
 */

The expected output is

Text.
More text.

In fact, the asterisk became part of the comment.

Expected: 'Text.\n'
            'More text.'
  Actual: 'Text.\n'
            ' *More text.'

See https://github.com/dart-lang/dartdoc/blob/main/test/co19/block_based_doc_comments_test.dart, the tests test_contentNoTrailingWhitespace1() and test_contentNoTrailingWhitespace2().

Dart SDK version: 3.11.0-260.0.dev (dev) (Thu Dec 18 12:03:14 2025 -0800) on "windows_x64"

Metadata

Metadata

Assignees

Labels

type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions