mirror of
https://github.com/russross/blackfriday.git
synced 2024-03-22 13:40:34 +08:00
ignore underscore conditionally
This commit is contained in:
parent
4c9bf95126
commit
fe39a1fa08
|
@ -47,6 +47,7 @@ const (
|
|||
AutoHeadingIDs // Create the heading ID from the text
|
||||
BackslashLineBreak // Translate trailing backslashes into line breaks
|
||||
DefinitionLists // Render definition lists
|
||||
IgnoreUnderscore // Ignore all underscores
|
||||
|
||||
CommonHTMLFlags HTMLFlags = UseXHTML | Smartypants |
|
||||
SmartypantsFractions | SmartypantsDashes | SmartypantsLatexDashes
|
||||
|
@ -285,7 +286,9 @@ func New(opts ...Option) *Markdown {
|
|||
// register inline parsers
|
||||
p.inlineCallback[' '] = maybeLineBreak
|
||||
p.inlineCallback['*'] = emphasis
|
||||
p.inlineCallback['_'] = emphasis
|
||||
if p.extensions&IgnoreUnderscore == 0 {
|
||||
p.inlineCallback['_'] = emphasis
|
||||
}
|
||||
if p.extensions&Strikethrough != 0 {
|
||||
p.inlineCallback['~'] = emphasis
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user