Skip to content

Commit

Permalink
fix: try fixing removal of \t
Browse files Browse the repository at this point in the history
  • Loading branch information
PeronGH authored and asjqkkkk committed Feb 23, 2024
1 parent 6df4980 commit 870c7c7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions example/lib/markdown_custom/html_support.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ List<SpanNode> parseHtml(
TextStyle? parentStyle,
}) {
try {
final text =
node.textContent.replaceAll(RegExp(r'(\r?\n)|(\r?\t)|(\r)'), '');
final text = node.textContent.replaceAll(RegExp(r'(\r?\n)|(\r)'), '');
if (!text.contains(htmlRep)) return [TextNode(text: node.text)];
h.DocumentFragment document = parseFragment(text);
return HtmlToSpanVisitor(visitor: visitor, parentStyle: parentStyle)
Expand Down
2 changes: 1 addition & 1 deletion example/test/html_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void main() {
test('test for html with visitor', () {
final m.Document document = m.Document(
extensionSet: m.ExtensionSet.gitHubFlavored, encodeHtml: false);
final List<String> lines = source.split(RegExp(r'(\r?\n)|(\r?\t)|(\r)'));
final List<String> lines = source.split(RegExp(r'(\r?\n)|(\r)'));
final List<m.Node> nodes = document.parseLines(lines);
final visitor = WidgetVisitor(
textGenerator: (node, config, visitor) =>
Expand Down
2 changes: 1 addition & 1 deletion lib/config/markdown_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class MarkdownGenerator {
inlineSyntaxes: inlineSyntaxList,
blockSyntaxes: blockSyntaxList,
);
final List<String> lines = data.split(RegExp(r'(\r?\n)|(\r?\t)|(\r)'));
final List<String> lines = data.split(RegExp(r'(\r?\n)|(\r)'));
final List<m.Node> nodes = document.parseLines(lines);
final List<Toc> tocList = [];
final visitor = WidgetVisitor(
Expand Down

0 comments on commit 870c7c7

Please sign in to comment.