Skip to content

Leading whitespace is not stripped in block comments #4150

@sgrekhov

Description

@sgrekhov

According to the dartdoc specification

On each line after the opening /**, any leading whitespace followed by a single asterisk (*) is considered stylistic and is stripped by doc generators.

But in fact the leading whitespace is not stripped. For example in case of

/** Text.
      * More text.
 */

The expected doc comment is

Text.
More text.

But in fact

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 test test_leadingWhitespace().

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