Commit cccfb3d78291c9064c6160f8a271350e29981fd1

Martin Mitas 2019-03-26T16:59:52

md_is_html_block_start_condition: Fix starting condition 1 when EOF follows. Fixes #68

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0293f3d..07b0593 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,14 @@
 # MD4C Change Log
 
 
+## Next Version (Work in Progress)
+
+Fixes:
+ * [#68](https://github.com/mity/md4c/issues/68):
+   Some specific HTML blocks were not recognized when EOF follows without any
+   end-of-line character.
+
+
 ## Version 0.3.1
 
 Fixes:
diff --git a/md4c/md4c.c b/md4c/md4c.c
index 0c35ab6..c92e8a5 100644
--- a/md4c/md4c.c
+++ b/md4c/md4c.c
@@ -5076,7 +5076,7 @@ md_is_html_block_start_condition(MD_CTX* ctx, OFF beg)
 
     /* Check for type 1: <script, <pre, or <style */
     for(i = 0; t1[i].name != NULL; i++) {
-        if(off + t1[i].len < ctx->size) {
+        if(off + t1[i].len <= ctx->size) {
             if(md_ascii_case_eq(STR(off), t1[i].name, t1[i].len))
                 return 1;
         }