Contents
Contents

Use of angle brackets in a doc comment is treated as HTML by Markdown.

This rule is currently experimental and not yet available in a stable SDK.

Details

#

DO reference only in-scope identifiers in doc comments.

When a developer writes a reference with angle brackets within a doc comment, the angle brackets are interpreted as HTML. The text within pairs of opening and closing angle brackets generally get swallowed by the browser, and will not be displayed.

Wrap text with angle brackets within a code block or within a code span, unless they are delimiters for a Markdown autolink. You can also replace < with &lt; and > with &gt;.

BAD:

dart
/// Text List<int>.
/// Text [List<int>].
/// <assignment> -> <variable> = <expression>

GOOD:

dart
/// Text `List<int>`.
/// `<assignment> -> <variable> = <expression>`
/// <http://foo.bar.baz>

Usage

#

To enable the unintended_html_in_doc_comment rule, add unintended_html_in_doc_comment under linter > rules in your analysis_options.yaml file:

analysis_options.yaml
yaml
linter:
  rules:
    - unintended_html_in_doc_comment