diff --git a/src/document.c b/src/document.c index 613fd6df..27c17b23 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 bbe4fc50..b0904da7 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, "", 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 00000000..c2a8bbad --- /dev/null +++ b/test/Tests/Underline.html @@ -0,0 +1 @@ +
This underline will work.
diff --git a/test/Tests/Underline.text b/test/Tests/Underline.text new file mode 100644 index 00000000..8068546c --- /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 b6ecb551..d3e170e8 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"] } ] }