all repos — grayfriday @ 38cc6e9ae8efc66a78d18737bd5e269ae672300d

blackfriday fork with a few changes

Add HTML_SMARTYPANTS_DASHES for toggling smart dashes
Anthony Fok foka@debian.org
Mon, 03 Aug 2015 23:57:26 -0600
commit

38cc6e9ae8efc66a78d18737bd5e269ae672300d

parent

8cec3a854e68dba10faabbe31c089abf4a3e57a6

3 files changed, 9 insertions(+), 5 deletions(-)

jump to
M html.gohtml.go

@@ -39,7 +39,8 @@ HTML_COMPLETE_PAGE // generate a complete HTML page

HTML_USE_XHTML // generate XHTML output instead of HTML HTML_USE_SMARTYPANTS // enable smart punctuation substitutions HTML_SMARTYPANTS_FRACTIONS // enable smart fractions (with HTML_USE_SMARTYPANTS) - HTML_SMARTYPANTS_LATEX_DASHES // enable LaTeX-style dashes (with HTML_USE_SMARTYPANTS) + HTML_SMARTYPANTS_DASHES // enable smart dashes (with HTML_USE_SMARTYPANTS) + HTML_SMARTYPANTS_LATEX_DASHES // enable LaTeX-style dashes (with HTML_USE_SMARTYPANTS and HTML_SMARTYPANTS_DASHES) HTML_SMARTYPANTS_ANGLED_QUOTES // enable angled double quotes (with HTML_USE_SMARTYPANTS) for double quotes rendering HTML_FOOTNOTE_RETURN_LINKS // generate a link at the end of a footnote to return to the source )
M markdown.gomarkdown.go

@@ -50,6 +50,7 @@ commonHtmlFlags = 0 |

HTML_USE_XHTML | HTML_USE_SMARTYPANTS | HTML_SMARTYPANTS_FRACTIONS | + HTML_SMARTYPANTS_DASHES | HTML_SMARTYPANTS_LATEX_DASHES commonExtensions = 0 |
M smartypants.gosmartypants.go

@@ -378,10 +378,12 @@ r['&'] = smartAmpAngledQuote

} r['\''] = smartSingleQuote r['('] = smartParens - if flags&HTML_SMARTYPANTS_LATEX_DASHES == 0 { - r['-'] = smartDash - } else { - r['-'] = smartDashLatex + if flags&HTML_SMARTYPANTS_DASHES != 0 { + if flags&HTML_SMARTYPANTS_LATEX_DASHES == 0 { + r['-'] = smartDash + } else { + r['-'] = smartDashLatex + } } r['.'] = smartPeriod if flags&HTML_SMARTYPANTS_FRACTIONS == 0 {