diff --git a/cmd/markdown/main.go b/cmd/markdown/main.go index f9c4b68..dc2b18b 100644 --- a/cmd/markdown/main.go +++ b/cmd/markdown/main.go @@ -15,6 +15,7 @@ func main() { var opt markdown.Extensions flag.BoolVar(&opt.Notes, "notes", false, "turn on footnote syntax") flag.BoolVar(&opt.Smart, "smart", false, "turn on smart quotes, dashes, and ellipses") + flag.BoolVar(&opt.Strike, "strike", false, "turn on strike-through syntax") flag.BoolVar(&opt.Dlists, "dlists", false, "support definitions lists") flag.Usage = func() { diff --git a/markdown.go b/markdown.go index a93222c..f639495 100644 --- a/markdown.go +++ b/markdown.go @@ -40,6 +40,7 @@ type Extensions struct { Notes bool FilterHTML bool FilterStyles bool + Strike bool Dlists bool } diff --git a/parser.leg b/parser.leg index 1246a5a..fc8b6b1 100644 --- a/parser.leg +++ b/parser.leg @@ -570,10 +570,11 @@ StrongUl = "__" !Whitespace "__" { $$ = p.mkList(STRONG, a) } -TwoTildeOpen = !TildeLine "~~" !Spacechar !Newline -TwoTildeClose = !Spacechar !Newline a:Inline "~~" { $$ = a; } +TwoTildeOpen = &{ p.extension.Strike } !TildeLine "~~" !Spacechar !Newline +TwoTildeClose = &{ p.extension.Strike } !Spacechar !Newline a:Inline "~~" { $$ = a; } -Strike = TwoTildeOpen +Strike = &{ p.extension.Strike } + TwoTildeOpen a:StartList ( !TwoTildeClose Inline { a = cons($$, a) } )* TwoTildeClose { a = cons($$, a) } diff --git a/portid b/portid index 259119c..6772f05 100644 --- a/portid +++ b/portid @@ -1 +1 @@ -9629df92a0de +a79c71ede83f