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
除非另有说明,文档之所提及适用于 Dart 3.5.0 版本,本页面最后更新时间: 2024-09-22。 查看文档源码 或者 报告页面问题。