From 915f7049a056d73eb3b479a446514e95adf9bb4c Mon Sep 17 00:00:00 2001 From: Martin Probst Date: Sat, 3 May 2014 12:34:16 +0200 Subject: [PATCH] Add a test for the correct handling of escaped entities in HTML. The sanitization code does not retain any particular escaped entities - it parses the HTML and thus loses the information on what entities were in the original. The result is correct UTF-8 HTML though. --- inline_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/inline_test.go b/inline_test.go index 3ed1485..48bf5f6 100644 --- a/inline_test.go +++ b/inline_test.go @@ -218,6 +218,17 @@ func TestRawHtmlTag(t *testing.T) { doTestsInlineParam(t, tests, 0, HTML_SKIP_STYLE|HTML_SANITIZE_OUTPUT) } +func TestQuoteEscaping(t *testing.T) { + tests := []string{ + "

Here are some "quotes".

\n", + "

Here are some "quotes".

\n", + + "

Here are some “quotes”.

\n", + "

Here are some \u201Cquotes\u201D.

\n", + } + doTestsInlineParam(t, tests, 0, HTML_SKIP_STYLE|HTML_SANITIZE_OUTPUT) +} + func TestEmphasis(t *testing.T) { var tests = []string{ "nothing inline\n",