Commit ccc8b64a96ebacea20e90a9b2f76962fdaba71a9

Martin Mitas 2021-07-15T18:56:46

md_html: Add `~` to the list of characters not escaped in URIs. Fixes #165.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/md4c-html.c b/src/md4c-html.c
index 22907f1..d604aec 100644
--- a/src/md4c-html.c
+++ b/src/md4c-html.c
@@ -555,7 +555,7 @@ md_html(const MD_CHAR* input, MD_SIZE input_size,
         if(strchr("\"&<>", ch) != NULL)
             render.escape_map[i] |= NEED_HTML_ESC_FLAG;
 
-        if(!ISALNUM(ch)  &&  strchr("-_.+!*(),%#@?=;:/,+$", ch) == NULL)
+        if(!ISALNUM(ch)  &&  strchr("~-_.+!*(),%#@?=;:/,+$", ch) == NULL)
             render.escape_map[i] |= NEED_URL_ESC_FLAG;
     }