~fancycade/chicken-cmark

f399b190385410c576b5182a07c9bffa88a63998 — Harley Swick 2 years ago 561deaa
Export commonmark->html for backwards compatibility, export alias, change cmark-string to cmark->sxml
1 files changed, 15 insertions(+), 2 deletions(-)

M cmark.scm
M cmark.scm => cmark.scm +15 -2
@@ 1,6 1,8 @@
(module
 cmark
 (cmark-string->sxml
 (cmark->sxml
  commonmark->html
  cmark->html
  CMARK_OPT_SAFE
  CMARK_OPT_DEFAULT
  CMARK_EVENT_NONE


@@ 618,7 620,7 @@
	 (loop (stack-interpret-node (car code) stack)
	       (cdr code)))))

 (define (cmark-string->sxml s)
 (define (cmark->sxml s)
   (let* ([root (cmark-parse-document s (string-length s) CMARK_OPT_DEFAULT)]
	  [iter (cmark-iter-new root)]
	  [code (cmark-iter->stack iter)]


@@ 626,4 628,15 @@
     (cmark-iter-free iter)
     (cmark-node-free root)
     sxml))

 (define cmark-markdown-to-html
   (foreign-lambda c-string "cmark_markdown_to_html" c-string size_t int))

 (define (commonmark->html input #!key (safe #t))
   (let ((opt (if safe CMARK_OPT_SAFE CMARK_OPT_DEFAULT)))
     (cmark-markdown-to-html input (string-length input) opt)))

 (define (cmark->html input #!key (safe #t))
   (let ((opt (if safe CMARK_OPT_SAFE CMARK_OPT_DEFAULT)))
     (cmark-markdown-to-html input (string-length input) opt)))
 )