Skip to content

Leading whitespaces are not removed for not the first line of a doc comment #4137

Open

Description

@sgrekhov

According to the Dart doc comment specification:

For each line that begins with ///, the parser removes the three slashes and all leading whitespace to produce the documentation text.

But in the case when there is at least one doc comment above the leading whitespaces are not removed. For example:

///  Text.
///    More text.

The output produced by the dartdoc is:

Text
  More text.

The test test_removesSpaceAfterTripleSlashes() in https://github.com/dart-lang/dartdoc/blob/main/test/co19/line_based_doc_comments_test.dart fails.

Activity

  1. added
    type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)
    on Dec 18, 2025
  2. self-assigned this
    on Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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