diff --git a/src/html.c b/src/html.c
index ddebff72..9eea3a10 100644
--- a/src/html.c
+++ b/src/html.c
@@ -586,7 +586,7 @@ toc_header(hoedown_buffer *ob, const hoedown_buffer *content, int level, const h
}
hoedown_buffer_printf(ob, "", state->toc_data.header_count++);
- if (content) escape_html(ob, content->data, content->size);
+ if (content) hoedown_buffer_put(ob, content->data, content->size);
HOEDOWN_BUFPUTSL(ob, "\n");
}
}
@@ -654,7 +654,7 @@ hoedown_html_toc_renderer_new(int nesting_level)
NULL,
NULL,
- NULL,
+ rndr_normal_text,
NULL,
toc_finalize
diff --git a/test/MarkdownTest_1.0.3/Tests/Formatting in Table of Contents.html b/test/MarkdownTest_1.0.3/Tests/Formatting in Table of Contents.html
new file mode 100644
index 00000000..8e7be95c
--- /dev/null
+++ b/test/MarkdownTest_1.0.3/Tests/Formatting in Table of Contents.html
@@ -0,0 +1,15 @@
+
diff --git a/test/MarkdownTest_1.0.3/Tests/Formatting in Table of Contents.text b/test/MarkdownTest_1.0.3/Tests/Formatting in Table of Contents.text
new file mode 100644
index 00000000..b95fbaa3
--- /dev/null
+++ b/test/MarkdownTest_1.0.3/Tests/Formatting in Table of Contents.text
@@ -0,0 +1,5 @@
+# Header with special & characters
+
+## With `Code`
+
+### With *Emphasis*
diff --git a/test/config.json b/test/config.json
index 63cb1d7f..35806861 100644
--- a/test/config.json
+++ b/test/config.json
@@ -24,6 +24,11 @@
"input": "MarkdownTest_1.0.3/Tests/Code Spans.text",
"output": "MarkdownTest_1.0.3/Tests/Code Spans.html"
},
+ {
+ "input": "MarkdownTest_1.0.3/Tests/Formatting in Table of Contents.text",
+ "output": "MarkdownTest_1.0.3/Tests/Formatting in Table of Contents.html",
+ "flags": ["--html-toc", "-t", "3"]
+ },
{
"input": "MarkdownTest_1.0.3/Tests/Hard-wrapped paragraphs with list-like lines.text",
"output": "MarkdownTest_1.0.3/Tests/Hard-wrapped paragraphs with list-like lines.html"