From 02da1dfe9d5b7bcdbc653280d52de5360737e481 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Wed, 10 Aug 2016 09:56:37 +0530 Subject: [PATCH] Factor Smartypants to HTML Smartypants is HTML-specific. There is no need to run Smartypants from `Render()`. This simplifies extensions built upon the HTML renderer. --- helpers_test.go | 2 +- html.go | 57 +++++++++++++++++++++++++------------------------ inline_test.go | 42 +++++++----------------------------- markdown.go | 49 +++++++++++++++++++----------------------- smartypants.go | 4 +--- 5 files changed, 61 insertions(+), 93 deletions(-) diff --git a/helpers_test.go b/helpers_test.go index 030caa5..99ac806 100644 --- a/helpers_test.go +++ b/helpers_test.go @@ -106,7 +106,7 @@ func doLinkTestsInline(t *testing.T, tests []string) { HTMLRendererParameters: params, }) doTestsInlineParam(t, transformTests, TestParams{ - HTMLFlags: CommonHTMLFlags, + HTMLFlags: UseXHTML, HTMLRendererParameters: params, }) } diff --git a/html.go b/html.go index 6e26d92..96fb655 100644 --- a/html.go +++ b/html.go @@ -29,18 +29,23 @@ type HTMLFlags int // HTML renderer configuration options. const ( - HTMLFlagsNone HTMLFlags = 0 - SkipHTML HTMLFlags = 1 << iota // Skip preformatted HTML blocks - SkipStyle // Skip embedded