summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Mendez <me@jmendeth.com>2015-04-08 00:18:20 +0200
committerXavier Mendez <me@jmendeth.com>2015-04-08 00:18:20 +0200
commit5951df7980f75cc0619ef68e925e2a4481b6a0b8 (patch)
treeb74e0a04df81b4a2f37d29bc893fe1460d7bbc0c
parent2b890c168326591e8d283cad7c2c9e6cb34d18db (diff)
parent2a4cf17c70e6572ed42cdca3ea7ca3e768ed17be (diff)
downloadrust-hoedown-5951df7980f75cc0619ef68e925e2a4481b6a0b8.tar.gz
Merge branch 'master' of https://github.com/hoedown/hoedown
-rw-r--r--src/document.c6
-rw-r--r--src/html_smartypants.c10
-rw-r--r--test/Tests/Underline.html1
-rw-r--r--test/Tests/Underline.text1
-rw-r--r--test/config.json5
5 files changed, 22 insertions, 1 deletions
diff --git a/src/document.c b/src/document.c
index 613fd6d..27c17b2 100644
--- a/src/document.c
+++ b/src/document.c
@@ -2752,6 +2752,10 @@ hoedown_document_new(
memset(doc->active_char, 0x0, 256);
+ if (extensions & HOEDOWN_EXT_UNDERLINE && doc->md.underline) {
+ doc->active_char['_'] = MD_CHAR_EMPHASIS;
+ }
+
if (doc->md.emphasis || doc->md.double_emphasis || doc->md.triple_emphasis) {
doc->active_char['*'] = MD_CHAR_EMPHASIS;
doc->active_char['_'] = MD_CHAR_EMPHASIS;
@@ -2767,7 +2771,7 @@ hoedown_document_new(
if (doc->md.linebreak)
doc->active_char['\n'] = MD_CHAR_LINEBREAK;
- if (doc->md.image || doc->md.link)
+ if (doc->md.image || doc->md.link || doc->md.footnotes || doc->md.footnote_ref)
doc->active_char['['] = MD_CHAR_LINK;
doc->active_char['<'] = MD_CHAR_LANGLE;
diff --git a/src/html_smartypants.c b/src/html_smartypants.c
index bbe4fc5..b0904da 100644
--- a/src/html_smartypants.c
+++ b/src/html_smartypants.c
@@ -313,6 +313,16 @@ smartypants_cb__ltag(hoedown_buffer *ob, struct smartypants_data *smrt, uint8_t
size_t tag, i = 0;
+ /* This is a comment. Copy everything verbatim until --> or EOF is seen. */
+ if (i + 4 < size && memcmp(text, "<!--", 4) == 0) {
+ i += 4;
+ while (i + 3 < size && memcmp(text + i, "-->", 3) != 0)
+ i++;
+ i += 3;
+ hoedown_buffer_put(ob, text, i + 1);
+ return i;
+ }
+
while (i < size && text[i] != '>')
i++;
diff --git a/test/Tests/Underline.html b/test/Tests/Underline.html
new file mode 100644
index 0000000..c2a8bba
--- /dev/null
+++ b/test/Tests/Underline.html
@@ -0,0 +1 @@
+<p>This <u>underline</u> will work.</p>
diff --git a/test/Tests/Underline.text b/test/Tests/Underline.text
new file mode 100644
index 0000000..8068546
--- /dev/null
+++ b/test/Tests/Underline.text
@@ -0,0 +1 @@
+This _underline_ will work.
diff --git a/test/config.json b/test/config.json
index b6ecb55..d3e170e 100644
--- a/test/config.json
+++ b/test/config.json
@@ -101,6 +101,11 @@
"input": "Tests/Math.text",
"output": "Tests/Math.html",
"flags": ["--math"]
+ },
+ {
+ "input": "Tests/Underline.text",
+ "output": "Tests/Underline.html",
+ "flags": ["--underline"]
}
]
}