Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/hoedown/hoedown
Browse files Browse the repository at this point in the history
  • Loading branch information
mildsunrise committed Apr 7, 2015
2 parents 2b890c1 + 2a4cf17 commit 5951df7
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/document.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
10 changes: 10 additions & 0 deletions src/html_smartypants.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;

Expand Down
1 change: 1 addition & 0 deletions test/Tests/Underline.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>This <u>underline</u> will work.</p>
1 change: 1 addition & 0 deletions test/Tests/Underline.text
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This _underline_ will work.
5 changes: 5 additions & 0 deletions test/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@
"input": "Tests/Math.text",
"output": "Tests/Math.html",
"flags": ["--math"]
},
{
"input": "Tests/Underline.text",
"output": "Tests/Underline.html",
"flags": ["--underline"]
}
]
}

0 comments on commit 5951df7

Please sign in to comment.