all repos — grayfriday @ 4d74c6a07120697f918d6fb4b90a2d3ee3355665

blackfriday fork with a few changes

Make common flags and extensions public

Add DefaultOptions convenience variable.
Vytautas Ĺ altenis vytas@rtfb.lt
Wed, 30 Mar 2016 19:29:00 +0300
commit

4d74c6a07120697f918d6fb4b90a2d3ee3355665

parent

dc7d4b68df04979f26d3303fa0fd2a33a2d14774

2 files changed, 9 insertions(+), 6 deletions(-)

jump to
M inline_test.goinline_test.go

@@ -42,7 +42,7 @@ prefix := "http://localhost"

params := HtmlRendererParameters{AbsolutePrefix: prefix} transformTests := transformLinks(tests, prefix) 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) {
M markdown.gomarkdown.go

@@ -50,13 +50,17 @@ AutoHeaderIDs // Create the header ID from the text

BackslashLineBreak // Translate trailing backslashes into line breaks DefinitionLists // Render definition lists - commonHtmlFlags HtmlFlags = UseXHTML | UseSmartypants | + CommonHtmlFlags HtmlFlags = UseXHTML | UseSmartypants | SmartypantsFractions | SmartypantsDashes | SmartypantsLatexDashes - commonExtensions Extensions = NoIntraEmphasis | Tables | FencedCode | + CommonExtensions Extensions = NoIntraEmphasis | Tables | FencedCode | Autolink | Strikethrough | SpaceHeaders | HeaderIDs | BackslashLineBreak | DefinitionLists ) + +var DefaultOptions = Options{ + Extensions: CommonExtensions, +} type LinkType int

@@ -364,9 +368,8 @@ //

// * Custom Header IDs func MarkdownCommon(input []byte) []byte { // set up the HTML renderer - renderer := HtmlRenderer(commonHtmlFlags, "", "") - return MarkdownOptions(input, renderer, Options{ - Extensions: commonExtensions}) + renderer := HtmlRenderer(CommonHtmlFlags, "", "") + return MarkdownOptions(input, renderer, DefaultOptions) } // Markdown is the main rendering function.