mirror of
https://github.com/russross/blackfriday.git
synced 2024-03-22 13:40:34 +08:00
Make common flags and extensions public
Add DefaultOptions convenience variable.
This commit is contained in:
parent
dc7d4b68df
commit
4d74c6a071
|
@ -42,7 +42,7 @@ func doLinkTestsInline(t *testing.T, tests []string) {
|
||||||
params := HtmlRendererParameters{AbsolutePrefix: prefix}
|
params := HtmlRendererParameters{AbsolutePrefix: prefix}
|
||||||
transformTests := transformLinks(tests, prefix)
|
transformTests := transformLinks(tests, prefix)
|
||||||
doTestsInlineParam(t, transformTests, Options{}, 0, params)
|
doTestsInlineParam(t, transformTests, Options{}, 0, params)
|
||||||
doTestsInlineParam(t, transformTests, Options{}, commonHtmlFlags, params)
|
doTestsInlineParam(t, transformTests, Options{}, CommonHtmlFlags, params)
|
||||||
}
|
}
|
||||||
|
|
||||||
func doSafeTestsInline(t *testing.T, tests []string) {
|
func doSafeTestsInline(t *testing.T, tests []string) {
|
||||||
|
|
13
markdown.go
13
markdown.go
|
@ -50,14 +50,18 @@ const (
|
||||||
BackslashLineBreak // Translate trailing backslashes into line breaks
|
BackslashLineBreak // Translate trailing backslashes into line breaks
|
||||||
DefinitionLists // Render definition lists
|
DefinitionLists // Render definition lists
|
||||||
|
|
||||||
commonHtmlFlags HtmlFlags = UseXHTML | UseSmartypants |
|
CommonHtmlFlags HtmlFlags = UseXHTML | UseSmartypants |
|
||||||
SmartypantsFractions | SmartypantsDashes | SmartypantsLatexDashes
|
SmartypantsFractions | SmartypantsDashes | SmartypantsLatexDashes
|
||||||
|
|
||||||
commonExtensions Extensions = NoIntraEmphasis | Tables | FencedCode |
|
CommonExtensions Extensions = NoIntraEmphasis | Tables | FencedCode |
|
||||||
Autolink | Strikethrough | SpaceHeaders | HeaderIDs |
|
Autolink | Strikethrough | SpaceHeaders | HeaderIDs |
|
||||||
BackslashLineBreak | DefinitionLists
|
BackslashLineBreak | DefinitionLists
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var DefaultOptions = Options{
|
||||||
|
Extensions: CommonExtensions,
|
||||||
|
}
|
||||||
|
|
||||||
type LinkType int
|
type LinkType int
|
||||||
|
|
||||||
// These are the possible flag values for the link renderer.
|
// These are the possible flag values for the link renderer.
|
||||||
|
@ -364,9 +368,8 @@ func MarkdownBasic(input []byte) []byte {
|
||||||
// * Custom Header IDs
|
// * Custom Header IDs
|
||||||
func MarkdownCommon(input []byte) []byte {
|
func MarkdownCommon(input []byte) []byte {
|
||||||
// set up the HTML renderer
|
// set up the HTML renderer
|
||||||
renderer := HtmlRenderer(commonHtmlFlags, "", "")
|
renderer := HtmlRenderer(CommonHtmlFlags, "", "")
|
||||||
return MarkdownOptions(input, renderer, Options{
|
return MarkdownOptions(input, renderer, DefaultOptions)
|
||||||
Extensions: commonExtensions})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Markdown is the main rendering function.
|
// Markdown is the main rendering function.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user