Skip to content

Commit f24a1bb

Browse files
authored
remove a deprecation warning (#1459)
1 parent 80b2a60 commit f24a1bb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/src/markdown_processor.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ const validHtmlTags = const [
117117
"video",
118118
"wbr"
119119
];
120+
120121
final RegExp nonHTML =
121122
new RegExp("</?(?!(${validHtmlTags.join("|")})[> ])\\w+[> ]");
122123

@@ -135,6 +136,8 @@ final RegExp isConstructor = new RegExp(r'^new[\s]+', multiLine: true);
135136
// Covers anything with leading digits/symbols, empty string, weird punctuation, spaces.
136137
final RegExp notARealDocReference = new RegExp(r'''(^[^\w]|^[\d]|[,"'/]|^$)''');
137138

139+
final HtmlEscape htmlEscape = const HtmlEscape(HtmlEscapeMode.ELEMENT);
140+
138141
final List<md.InlineSyntax> _markdown_syntaxes = [
139142
new _InlineCodeSyntax(),
140143
new _AutolinkWithoutScheme()
@@ -934,7 +937,7 @@ class _AutolinkWithoutScheme extends md.AutolinkSyntax {
934937
@override
935938
bool onMatch(md.InlineParser parser, Match match) {
936939
var url = match[1];
937-
var text = md.escapeHtml(url).replaceFirst(_hide_schemes, '');
940+
var text = htmlEscape.convert(url).replaceFirst(_hide_schemes, '');
938941
var anchor = new md.Element.text('a', text);
939942
anchor.attributes['href'] = url;
940943
parser.addNode(anchor);

0 commit comments

Comments
 (0)