From 6a125184b6239e818d0eeea521d524b1f717eca7 Mon Sep 17 00:00:00 2001 From: Zhiguang Chen Date: Fri, 8 Mar 2024 12:07:02 +0100 Subject: [PATCH] Add single tilde support to `StrikethroughSyntax` --- lib/src/inline_syntaxes/strikethrough_syntax.dart | 2 +- test/gfm/strikethrough_extension.unit | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/src/inline_syntaxes/strikethrough_syntax.dart b/lib/src/inline_syntaxes/strikethrough_syntax.dart index ddb0eefd..ebe5e1a6 100644 --- a/lib/src/inline_syntaxes/strikethrough_syntax.dart +++ b/lib/src/inline_syntaxes/strikethrough_syntax.dart @@ -13,6 +13,6 @@ class StrikethroughSyntax extends DelimiterSyntax { requiresDelimiterRun: true, allowIntraWord: true, startCharacter: $tilde, - tags: [DelimiterTag('del', 2)], + tags: [DelimiterTag('del', 1), DelimiterTag('del', 2)], ); } diff --git a/test/gfm/strikethrough_extension.unit b/test/gfm/strikethrough_extension.unit index be4d41c0..0d6f75f9 100644 --- a/test/gfm/strikethrough_extension.unit +++ b/test/gfm/strikethrough_extension.unit @@ -9,3 +9,11 @@ new paragraph~~. <<<

This ~~has a

new paragraph~~.

+>>> single tilde +~Hi~ there. +<<< +

Hi there.

+>>> single tilde with double tilde +~Hi~~ there. +<<< +

Hi~ there.