disable strike-through extension by default [jgm/peg-markdown]
See https://github.com/jgm/peg-markdown/commit/9556c54
This commit is contained in:
parent
13604f76a7
commit
53573d327b
@ -15,6 +15,7 @@ func main() {
|
|||||||
var opt markdown.Extensions
|
var opt markdown.Extensions
|
||||||
flag.BoolVar(&opt.Notes, "notes", false, "turn on footnote syntax")
|
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.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.BoolVar(&opt.Dlists, "dlists", false, "support definitions lists")
|
||||||
|
|
||||||
flag.Usage = func() {
|
flag.Usage = func() {
|
||||||
|
@ -40,6 +40,7 @@ type Extensions struct {
|
|||||||
Notes bool
|
Notes bool
|
||||||
FilterHTML bool
|
FilterHTML bool
|
||||||
FilterStyles bool
|
FilterStyles bool
|
||||||
|
Strike bool
|
||||||
Dlists bool
|
Dlists bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -570,10 +570,11 @@ StrongUl = "__" !Whitespace
|
|||||||
"__"
|
"__"
|
||||||
{ $$ = p.mkList(STRONG, a) }
|
{ $$ = p.mkList(STRONG, a) }
|
||||||
|
|
||||||
TwoTildeOpen = !TildeLine "~~" !Spacechar !Newline
|
TwoTildeOpen = &{ p.extension.Strike } !TildeLine "~~" !Spacechar !Newline
|
||||||
TwoTildeClose = !Spacechar !Newline a:Inline "~~" { $$ = a; }
|
TwoTildeClose = &{ p.extension.Strike } !Spacechar !Newline a:Inline "~~" { $$ = a; }
|
||||||
|
|
||||||
Strike = TwoTildeOpen
|
Strike = &{ p.extension.Strike }
|
||||||
|
TwoTildeOpen
|
||||||
a:StartList
|
a:StartList
|
||||||
( !TwoTildeClose Inline { a = cons($$, a) } )*
|
( !TwoTildeClose Inline { a = cons($$, a) } )*
|
||||||
TwoTildeClose { a = cons($$, a) }
|
TwoTildeClose { a = cons($$, a) }
|
||||||
|
Loading…
Reference in New Issue
Block a user