Skip to content

Commit

Permalink
Merge pull request #455 from camdencheek/support-single-tilde-striket…
Browse files Browse the repository at this point in the history
…hrough

GitHub flavored markdown: support single-tilde strikethrough
  • Loading branch information
yuin authored Jun 14, 2024
2 parents c15e394 + 9c09ae0 commit fde4948
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions extension/_test/strikethrough.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,12 @@ new paragraph~~.
<p>This ~~has a</p>
<p>new paragraph~~.</p>
//= = = = = = = = = = = = = = = = = = = = = = = =//



3
//- - - - - - - - -//
~Hi~ Hello, world!
//- - - - - - - - -//
<p><del>Hi</del> Hello, world!</p>
//= = = = = = = = = = = = = = = = = = = = = = = =//
2 changes: 1 addition & 1 deletion extension/strikethrough.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit fde4948

Please sign in to comment.