You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2016/02/23 14:31:27 UTC

[4/6] lucy-clownfish git commit: Change libcmark parser and render options

Change libcmark parser and render options

CMARK_OPT_SAFE is a render option. CMARK_OPT_NORMALIZE shouldn't be
needed for POD.


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/82f8cf5e
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/82f8cf5e
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/82f8cf5e

Branch: refs/heads/master
Commit: 82f8cf5e69265f3ad46e8661fd0a4c43b44f3cd9
Parents: 07f37d6
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Tue Feb 23 12:31:25 2016 +0100
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Tue Feb 23 13:25:53 2016 +0100

----------------------------------------------------------------------
 compiler/src/CFCCHtml.c   |  5 ++---
 compiler/src/CFCCMan.c    |  3 +--
 compiler/src/CFCPerlPod.c | 12 ++++--------
 3 files changed, 7 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/82f8cf5e/compiler/src/CFCCHtml.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCCHtml.c b/compiler/src/CFCCHtml.c
index f357443..b44aea7 100644
--- a/compiler/src/CFCCHtml.c
+++ b/compiler/src/CFCCHtml.c
@@ -946,11 +946,10 @@ S_html_create_inheritance(CFCClass *klass) {
 static char*
 S_md_to_html(const char *md, CFCClass *klass, int dir_level) {
     int options = CMARK_OPT_SMART
-                  | CMARK_OPT_VALIDATE_UTF8
-                  | CMARK_OPT_SAFE;
+                  | CMARK_OPT_VALIDATE_UTF8;
     cmark_node *doc = cmark_parse_document(md, strlen(md), options);
     S_transform_doc(doc, klass, dir_level);
-    char *html = cmark_render_html(doc, CMARK_OPT_DEFAULT);
+    char *html = cmark_render_html(doc, CMARK_OPT_SAFE);
     cmark_node_free(doc);
 
     return html;

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/82f8cf5e/compiler/src/CFCCMan.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCCMan.c b/compiler/src/CFCCMan.c
index 5b98c88..732be0f 100644
--- a/compiler/src/CFCCMan.c
+++ b/compiler/src/CFCCMan.c
@@ -414,8 +414,7 @@ static char*
 S_md_to_man(CFCClass *klass, const char *md, int level) {
     int options = CMARK_OPT_NORMALIZE
                   | CMARK_OPT_SMART
-                  | CMARK_OPT_VALIDATE_UTF8
-                  | CMARK_OPT_SAFE;
+                  | CMARK_OPT_VALIDATE_UTF8;
     cmark_node *doc = cmark_parse_document(md, strlen(md), options);
     char *result = S_nodes_to_man(klass, doc, level);
     cmark_node_free(doc);

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/82f8cf5e/compiler/src/CFCPerlPod.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCPerlPod.c b/compiler/src/CFCPerlPod.c
index 409dc4a..632eb35 100644
--- a/compiler/src/CFCPerlPod.c
+++ b/compiler/src/CFCPerlPod.c
@@ -579,10 +579,8 @@ S_camel_to_lower(const char *camel) {
 
 char*
 CFCPerlPod_md_doc_to_pod(const char *module, const char *md) {
-    int options = CMARK_OPT_NORMALIZE
-                  | CMARK_OPT_SMART
-                  | CMARK_OPT_VALIDATE_UTF8
-                  | CMARK_OPT_SAFE;
+    int options = CMARK_OPT_SMART
+                  | CMARK_OPT_VALIDATE_UTF8;
     cmark_node *doc = cmark_parse_document(md, strlen(md), options);
     cmark_node *maybe_header = cmark_node_first_child(doc);
     char *name;
@@ -621,10 +619,8 @@ CFCPerlPod_md_doc_to_pod(const char *module, const char *md) {
 
 char*
 CFCPerlPod_md_to_pod(const char *md, CFCClass *klass, int header_level) {
-    int options = CMARK_OPT_NORMALIZE
-                  | CMARK_OPT_SMART
-                  | CMARK_OPT_VALIDATE_UTF8
-                  | CMARK_OPT_SAFE;
+    int options = CMARK_OPT_SMART
+                  | CMARK_OPT_VALIDATE_UTF8;
     cmark_node *doc = cmark_parse_document(md, strlen(md), options);
     char *pod = S_node_to_pod(doc, klass, header_level);
     cmark_node_free(doc);