Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pkgs/markdown/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
so that the created link can contain that content.
* For testing the package, adds matchers for `Element` and `Text` to more
directly test the output parsing.
* Fixes an issue such that `markdownToHtml`, when given `inlineOnly: true`,
now respects `enableTagfilter: true`.

## 7.3.1

Expand Down
7 changes: 6 additions & 1 deletion pkgs/markdown/lib/src/html_renderer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ String markdownToHtml(
withDefaultInlineSyntaxes: withDefaultInlineSyntaxes,
);

if (inlineOnly) return renderToHtml(document.parseInline(markdown));
if (inlineOnly) {
return renderToHtml(
document.parseInline(markdown),
enableTagfilter: enableTagfilter,
);
}

final nodes = document.parse(markdown);

Expand Down
7 changes: 7 additions & 0 deletions pkgs/markdown/test/markdown_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,13 @@ nyan''',
''',
inlineOnly: true,
);
validateCore(
'filters disallowed html tags when enableTagfilter is true',
'foo <title> bar',
'foo &lt;title> bar',
inlineOnly: true,
enableTagfilter: true,
);
});

group('ExtensionSet', () {
Expand Down
Loading