all repos — grayfriday @ 4b26653fe00067c22322249d58654737e44b0dfb

blackfriday fork with a few changes

Fix broken test and add test for HTML_SMARTYPANTS_DASHES
Vytautas Ĺ altenis vytas@rtfb.lt
Tue, 27 Oct 2015 20:21:08 +0200
commit

4b26653fe00067c22322249d58654737e44b0dfb

parent

6712f32cfd36fbe8ef4fc7088eb01a5b368ab07d

1 files changed, 39 insertions(+), 1 deletions(-)

jump to
M inline_test.goinline_test.go

@@ -1026,7 +1026,7 @@

"blahblah\n<!--- foo -->\nrhubarb\n", "<p>blahblah\n<!--- foo -->\nrhubarb</p>\n", } - doTestsInlineParam(t, tests, Options{}, HTML_USE_SMARTYPANTS, HtmlRendererParameters{}) + doTestsInlineParam(t, tests, Options{}, HTML_USE_SMARTYPANTS|HTML_SMARTYPANTS_DASHES, HtmlRendererParameters{}) } func TestSmartDoubleQuotes(t *testing.T) {

@@ -1070,3 +1070,41 @@ "<p>1/2/2015, 1/4/2015, 3/4/2015; 2015/1/2, 2015/1/4, 2015/3/4.</p>\n"}

doTestsInlineParam(t, tests, Options{}, HTML_USE_SMARTYPANTS|HTML_SMARTYPANTS_FRACTIONS, HtmlRendererParameters{}) } + +func TestDisableSmartDashes(t *testing.T) { + doTestsInlineParam(t, []string{ + "foo - bar\n", + "<p>foo - bar</p>\n", + "foo -- bar\n", + "<p>foo -- bar</p>\n", + "foo --- bar\n", + "<p>foo --- bar</p>\n", + }, Options{}, 0, HtmlRendererParameters{}) + doTestsInlineParam(t, []string{ + "foo - bar\n", + "<p>foo &ndash; bar</p>\n", + "foo -- bar\n", + "<p>foo &mdash; bar</p>\n", + "foo --- bar\n", + "<p>foo &mdash;&ndash; bar</p>\n", + }, Options{}, HTML_USE_SMARTYPANTS|HTML_SMARTYPANTS_DASHES, HtmlRendererParameters{}) + doTestsInlineParam(t, []string{ + "foo - bar\n", + "<p>foo - bar</p>\n", + "foo -- bar\n", + "<p>foo &ndash; bar</p>\n", + "foo --- bar\n", + "<p>foo &mdash; bar</p>\n", + }, Options{}, HTML_USE_SMARTYPANTS|HTML_SMARTYPANTS_LATEX_DASHES|HTML_SMARTYPANTS_DASHES, + HtmlRendererParameters{}) + doTestsInlineParam(t, []string{ + "foo - bar\n", + "<p>foo - bar</p>\n", + "foo -- bar\n", + "<p>foo -- bar</p>\n", + "foo --- bar\n", + "<p>foo --- bar</p>\n", + }, Options{}, + HTML_USE_SMARTYPANTS|HTML_SMARTYPANTS_LATEX_DASHES, + HtmlRendererParameters{}) +}