From: Fletcher T. Penney Date: Tue, 14 Mar 2017 23:12:21 +0000 (-0400) Subject: FIXED: Fix bug with ATX Headers without newline X-Git-Tag: 6.0.0-rc1^2~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=439e322d5ace5eb431e3c6525486019a7823cd21;p=multimarkdown FIXED: Fix bug with ATX Headers without newline --- diff --git a/Sources/libMultiMarkdown/mmd.c b/Sources/libMultiMarkdown/mmd.c index 295dd58..ee3026f 100644 --- a/Sources/libMultiMarkdown/mmd.c +++ b/Sources/libMultiMarkdown/mmd.c @@ -813,8 +813,13 @@ token * mmd_tokenize_string(mmd_engine * e, const char * str, size_t len, bool s token_append_child(line, t); } } + } else if (type == 0 && stop > last_stop) { + // Source text ends without newline + t = token_new(TEXT_PLAIN, (size_t)(last_stop - str), (size_t)(stop - last_stop)); + token_append_child(line, t); } + switch (type) { case 0: // 0 means we finished with input