INNER CODE UNIT · Dart
AutolinkNoLeadingSpaceSyntax
asjqkkkk/markdown_widget · lib/config/autolink_no_leading_space_syntax.dart:18
class AutolinkNoLeadingSpaceSyntax extends m.InlineSyntax {
static const _linkPattern =
r'(?:(?:https?|ftp):\/\/|www\.)'
// A valid domain consists of segments of alphanumeric characters,
// underscores (_) and hyphens (-) separated by periods (.). There must
// be at least one period, and no underscores may be present in the last
// two segments of the domain.
r'(?:[-_a-z0-9]+\.)*(?:[-a-z0-9]+\.[-a-z0-9]+)'
// After a valid domain, zero or more non-space non-< characters may
// follow.
r'[^\s<]*'
// Trailing punctuation (specifically, ?, !, ., ,, :, *, _, and ~) will
// not be considered part of the autolink, though they may be included in
// the interior of the link.
r'[^\s<?!.,:*_~]';