From 9c09ae0019156130382d679e6581337581ed6c4a Mon Sep 17 00:00:00 2001 From: Camden Cheek Date: Tue, 11 Jun 2024 11:16:22 -0600 Subject: [PATCH] support single-tilde strikethrough --- extension/_test/strikethrough.txt | 9 +++++++++ extension/strikethrough.go | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/extension/_test/strikethrough.txt b/extension/_test/strikethrough.txt index dbb48f6..e74f58d 100644 --- a/extension/_test/strikethrough.txt +++ b/extension/_test/strikethrough.txt @@ -16,3 +16,12 @@ new paragraph~~.

This ~~has a

new paragraph~~.

//= = = = = = = = = = = = = = = = = = = = = = = =// + + + +3 +//- - - - - - - - -// +~Hi~ Hello, world! +//- - - - - - - - -// +

Hi Hello, world!

+//= = = = = = = = = = = = = = = = = = = = = = = =// diff --git a/extension/strikethrough.go b/extension/strikethrough.go index 7d13569..fbb099f 100644 --- a/extension/strikethrough.go +++ b/extension/strikethrough.go @@ -46,7 +46,7 @@ func (s *strikethroughParser) Trigger() []byte { func (s *strikethroughParser) Parse(parent gast.Node, block text.Reader, pc parser.Context) gast.Node { before := block.PrecendingCharacter() line, segment := block.PeekLine() - node := parser.ScanDelimiter(line, before, 2, defaultStrikethroughDelimiterProcessor) + node := parser.ScanDelimiter(line, before, 1, defaultStrikethroughDelimiterProcessor) if node == nil { return nil }