Skip to content

Commit d26f79e

Browse files
authored
Fix doc comment bugs, enable the corresponding lint (#2245)
1 parent 37f8242 commit d26f79e

File tree

6 files changed

+27
-10
lines changed

6 files changed

+27
-10
lines changed

pkgs/markdown/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
* Update `package:web` API references in the example.
88
* Fix performance and correctness of HTML comment parser.
99
* Optimize indentation processing of fenced code blocks.
10-
* Require Dart `^3.4.0`.
1110
* Fix an issue with nested list structure when indented by tabs (#2172).
11+
* Deprecated `LinkContext` and `BlockParser.standardBlockSyntaxes`.
12+
Implementation members that should never have been made public.
13+
* Require Dart `^3.4.0`.
1214

1315
## 7.3.0
1416

pkgs/markdown/analysis_options.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,9 @@ analyzer:
1111
# The example app explicitly takes a String of user-generated HTML and
1212
# inserts it straight into a <div> using innerHtml.
1313
unsafe_html: ignore
14-
# Waiting on a couple of bug fixes and new features before this should be enabled
15-
comment_references: ignore
1614

1715
linter:
1816
rules:
19-
# https://github.com/dart-lang/linter/issues/574
20-
#- comment_references
2117
- avoid_private_typedef_functions
2218
- avoid_redundant_argument_values
2319
- avoid_unused_constructor_parameters

pkgs/markdown/lib/markdown.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@
3636
/// - Creating a new [ExtensionSet] from one of the existing flavors
3737
/// and adding your syntaxes.
3838
/// - Passing your syntaxes to [Document] or [markdownToHtml] as parameters.
39+
/// @docImport 'src/ast.dart';
40+
/// @docImport 'src/block_syntaxes/block_syntax.dart';
41+
/// @docImport 'src/document.dart';
42+
/// @docImport 'src/extension_set.dart';
43+
/// @docImport 'src/html_renderer.dart';
44+
/// @docImport 'src/inline_syntaxes/inline_syntax.dart';
3945
library;
4046

4147
import 'src/version.dart';

pkgs/markdown/lib/src/block_parser.dart

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5+
/// @docImport 'block_syntaxes/setext_header_syntax.dart';
6+
library;
7+
58
import 'ast.dart';
69
import 'block_syntaxes/block_syntax.dart';
710
import 'block_syntaxes/blockquote_syntax.dart';
@@ -53,6 +56,10 @@ class BlockParser {
5356
bool encounteredBlankLine = false;
5457

5558
/// The collection of built-in block parsers.
59+
// TODO(kevmoo): this should be static const and private!
60+
// The fact that it's mutable is a BUG!
61+
@Deprecated('Implementation member. '
62+
'Will be removed or make static in the next release.')
5663
final List<BlockSyntax> standardBlockSyntaxes = [
5764
const EmptyBlockSyntax(),
5865
const HtmlBlockSyntax(),
@@ -135,7 +142,7 @@ class BlockParser {
135142
BlockSyntax? get parentSyntax => _parentSyntax;
136143
BlockSyntax? _parentSyntax;
137144

138-
/// Whether the [SetextHeadingSyntax] is disabled temporarily.
145+
/// Whether the [SetextHeaderSyntax] is disabled temporarily.
139146
bool get setextHeadingDisabled => _setextHeadingDisabled;
140147
bool _setextHeadingDisabled = false;
141148

pkgs/markdown/lib/src/inline_syntaxes/footnote_ref_syntax.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/// @docImport 'link_syntax.dart';
2+
library;
3+
14
import '../ast.dart' show Element, Node, Text;
25
import '../charcode.dart';
36
import 'link_syntax.dart' show LinkContext;

pkgs/markdown/lib/src/inline_syntaxes/link_syntax.dart

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ import 'delimiter_syntax.dart';
1111
import 'footnote_ref_syntax.dart';
1212

1313
/// A helper class holds params of link context.
14-
/// Footnote creation needs other info in [_tryCreateReferenceLink].
14+
// Footnote creation needs other info in [LinkSyntax._tryCreateReferenceLink].
15+
// TODO(kevmoo): this type should be private. Ideally a Record.
16+
@Deprecated('Implementation class that should not be used directly.')
1517
class LinkContext {
1618
final InlineParser parser;
1719
final SimpleDelimiter opener;
@@ -202,8 +204,8 @@ class LinkSyntax extends DelimiterSyntax {
202204

203205
/// Parse a reference link label at the current position.
204206
///
205-
/// Specifically, [parser.pos] is expected to be pointing at the `[` which
206-
/// opens the link label.
207+
/// Specifically, [InlineParser.pos] is expected to be pointing at the
208+
/// `[` which opens the link label.
207209
///
208210
/// Returns the label if it could be parsed, or `null` if not.
209211
String? _parseReferenceLinkLabel(InlineParser parser) {
@@ -245,7 +247,8 @@ class LinkSyntax extends DelimiterSyntax {
245247
/// Parse an inline [InlineLink] at the current position.
246248
///
247249
/// At this point, we have parsed a link's (or image's) opening `[`, and then
248-
/// a matching closing `]`, and [parser.pos] is pointing at an opening `(`.
250+
/// a matching closing `]`, and [InlineParser.pos] is pointing at an opening
251+
/// `(`.
249252
/// This method will then attempt to parse a link destination wrapped in `<>`,
250253
/// such as `(<http://url>)`, or a bare link destination, such as
251254
/// `(http://url)`, or a link destination with a title, such as

0 commit comments

Comments
 (0)