1
0
mirror of https://github.com/danog/blackfriday.git synced 2024-11-30 04:29:13 +01:00

Fix broken test and add test for HTML_SMARTYPANTS_DASHES

This commit is contained in:
Vytautas Šaltenis 2015-10-27 20:21:08 +02:00
parent 6712f32cfd
commit 4b26653fe0

View File

@ -1026,7 +1026,7 @@ func TestInlineComments(t *testing.T) {
"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 @@ func TestSmartFractions(t *testing.T) {
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{})
}