unintended_html_in_doc_comment
Use of angle brackets in a doc comment is treated as HTML by Markdown.
This rule is available as of Dart 3.5.0.
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.
You can use a code block or code span to wrap the text containing angle brackets. You can also replace <
with <
and >
with >
.
BAD:
/// Text List<int>.
/// Text [List<int>].
/// <assignment> -> <variable> = <expression>
GOOD:
/// 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:
linter:
rules:
- unintended_html_in_doc_comment
Unless stated otherwise, the documentation on this site reflects Dart 3.5.3. Page last updated on 2024-07-03. View source or report an issue.