From c641dc1436a00aadc1a6aa46508f88dae26c29a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Israel=20Pe=C3=B1a?= Date: Sat, 31 Jan 2015 00:02:28 -0800 Subject: [PATCH] only set active_char if extension is on --- src/document.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/document.c b/src/document.c index ec781e5..66ecd3c 100644 --- a/src/document.c +++ b/src/document.c @@ -2751,7 +2751,11 @@ hoedown_document_new( memset(doc->active_char, 0x0, 256); - if (doc->md.emphasis || doc->md.double_emphasis || doc->md.triple_emphasis || doc->md.underline) { + 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; if (extensions & HOEDOWN_EXT_STRIKETHROUGH)