| Index: pkg/dartdoc/lib/src/markdown/inline_parser.dart
|
| diff --git a/pkg/dartdoc/lib/src/markdown/inline_parser.dart b/pkg/dartdoc/lib/src/markdown/inline_parser.dart
|
| index d396f2d8b8430cd00768c3809a5782d9b613a4f4..587edf7745b7308e15ac5cbfc382203ae43e8cb1 100644
|
| --- a/pkg/dartdoc/lib/src/markdown/inline_parser.dart
|
| +++ b/pkg/dartdoc/lib/src/markdown/inline_parser.dart
|
| @@ -9,6 +9,18 @@ class InlineParser {
|
| // Lazy initialize.
|
| if (_syntaxes == null) {
|
| _syntaxes = <InlineSyntax>[
|
| + // This first regexp matches plain text to accelerate parsing. It must
|
| + // be written so that it does not match any prefix of any following
|
| + // syntax. Most markdown is plain text, so it is faster to match one
|
| + // regexp per 'word' rather than fail to match all the following regexps
|
| + // at each non-syntax character position. It is much more important
|
| + // that the regexp is fast than complete (for example, adding grouping
|
| + // is likely to slow the regexp down enough to negate its benefit).
|
| + // Since it is purely for optimization, it can be removed for debugging.
|
| + new TextSyntax(r'\s*[A-Za-z0-9]+'),
|
| +
|
| + // The real syntaxes.
|
| +
|
| new AutolinkSyntax(),
|
| new LinkSyntax(),
|
| // "*" surrounded by spaces is left alone.
|
|
|