Browse Source

Update cmark-gfm to 0.28.3.gfm.19

Of course right after I did that last update, they released two more new
versions of cmark-gfm, so here we go again.

The .18 update defaults to "safe" mode, but I want to disable that and
leave sanitization up to Bleach, so this required changing the options.
merge-requests/51/head
Deimos 6 years ago
parent
commit
29f7369da3
  1. 4
      salt/salt/cmark-gfm.sls
  2. 8
      tildes/tildes/lib/cmark.py

4
salt/salt/cmark-gfm.sls

@ -3,8 +3,8 @@ unpack-cmark-gfm:
- name: /tmp/cmark-gfm - name: /tmp/cmark-gfm
- source: - source:
- salt://cmark-gfm.tar.gz - salt://cmark-gfm.tar.gz
- https://github.com/github/cmark-gfm/archive/0.28.3.gfm.17.tar.gz
- source_hash: sha256=101ccfcd4f0fd8b05c20994006d992f2e81d6f96655afee4c66742ccc21f1f7d
- https://github.com/github/cmark-gfm/archive/0.28.3.gfm.19.tar.gz
- source_hash: sha256=d2c8cb255e227d07533a32cfd4a052e189f697e2a9681d8b17d15654259e2e4b
- if_missing: /usr/local/lib/libcmark-gfm.so - if_missing: /usr/local/lib/libcmark-gfm.so
- options: --strip-components=1 - options: --strip-components=1
- enforce_toplevel: False - enforce_toplevel: False

8
tildes/tildes/lib/cmark.py

@ -7,9 +7,11 @@ 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_DLL = CDLL("/usr/local/lib/libcmark-gfm.so")
CMARK_EXT_DLL = CDLL("/usr/local/lib/libcmark-gfm-extensions.so") CMARK_EXT_DLL = CDLL("/usr/local/lib/libcmark-gfm-extensions.so")
# enables the --hardbreaks option for cmark
# (can I import this? it's defined in cmark.h as CMARK_OPT_HARDBREAKS)
CMARK_OPTS = 4
# 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)
# CMARK_OPT_UNSAFE (1 << 17)
CMARK_OPTS = (1 << 2) | (1 << 17)
CMARK_EXTENSIONS = (b"strikethrough", b"table") CMARK_EXTENSIONS = (b"strikethrough", b"table")

Loading…
Cancel
Save