From 4a2d07733bd312492fcaf900cc4572cf71093079 Mon Sep 17 00:00:00 2001 From: Christopher Wellons Date: Sun, 17 Feb 2019 10:47:21 -0500 Subject: [PATCH] Don't enable --hardbreaks option in cmark Discussion here: https://tild.es/ajm Hard line breaks is unusual for Markdown, which normally follows HTML's behavior with line break, and it isn't something that users familiar with Markdown would expect. --- tildes/tildes/lib/cmark.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tildes/tildes/lib/cmark.py b/tildes/tildes/lib/cmark.py index d17b4ed..4a9dd3b 100644 --- a/tildes/tildes/lib/cmark.py +++ b/tildes/tildes/lib/cmark.py @@ -7,11 +7,10 @@ from ctypes import CDLL, c_char_p, c_int, c_size_t, c_void_p CMARK_DLL = CDLL("/usr/local/lib/libcmark-gfm.so") CMARK_EXT_DLL = CDLL("/usr/local/lib/libcmark-gfm-extensions.so") -# Enable the --hardbreaks and --unsafe options for cmark -# Can we import these somehow? They're defined in cmark.h as: -# CMARK_OPT_HARDBREAKS (1 << 2) +# Enable the --unsafe option for cmark +# Can we import this somehow? It's defined in cmark.h as: # CMARK_OPT_UNSAFE (1 << 17) -CMARK_OPTS = (1 << 2) | (1 << 17) +CMARK_OPTS = (1 << 17) CMARK_EXTENSIONS = (b"autolink", b"strikethrough", b"table")