cmark

My personal build of CMark ✏️

Commit
af5bff782a9682531da0dec6469748cd0ea48489
Parent
d7aec31cf9bfb616f648e85b086e1e683a2d3629
Author
John MacFarlane <jgm@berkeley.edu>
Date

Fixed man escaping for unicode characters.

Diffstat

1 file changed, 3 insertions, 3 deletions

Status File Name N° Changes Insertions Deletions
Modified src/man.c 6 3 3
diff --git a/src/man.c b/src/man.c
@@ -25,14 +25,14 @@ static void escape_man(cmark_strbuf *dest, const unsigned char *source, int leng
 			if (beginLine) {
 				cmark_strbuf_puts(dest, "\\&.");
 			} else {
-				cmark_strbuf_putc(dest, source[i]);
+				utf8proc_encode_char(c, dest);
 			}
 			break;
 		case 39:
 			if (beginLine) {
 				cmark_strbuf_puts(dest, "\\&'");
 			} else {
-				cmark_strbuf_putc(dest, source[i]);
+				utf8proc_encode_char(c, dest);
 			}
 			break;
 		case 45:
@@ -60,7 +60,7 @@ static void escape_man(cmark_strbuf *dest, const unsigned char *source, int leng
 			cmark_strbuf_puts(dest, "\\[en]");
 			break;
 		default:
-			cmark_strbuf_putc(dest, source[i]);
+			utf8proc_encode_char(c, dest);
 		}
 		beginLine = (c == 10);
 		i += len;