Just posted the patch earlier on this list, here it is:

Index: src/json_wiki.c
==================================================================
--- src/json_wiki.c
+++ src/json_wiki.c
@@ -110,19 +110,27 @@
                     json_julian_to_timestamp(pWiki->rDate));
     if(0 == contentFormat){
       cson_object_set(pay,"size",
json_new_int((cson_int_t)(zBody?strlen(zBody):0)));
     }else{
-      if( contentFormat>0 ){/*HTML-ize it*/
+      if (contentFormat > 0) {
         Blob content = empty_blob;
         Blob raw = empty_blob;
         zFormat = "html";
+
         if(zBody && *zBody){
           blob_append(&raw,zBody,-1);
-          wiki_convert(&raw,&content,0);
+
+ if( pWiki->zMimetype==0 || fossil_strcmp(pWiki->zMimetype, "text/x-fossil-wiki")==0 ){
+            wiki_convert(&raw,&content,0);
+ }else if( fossil_strcmp(pWiki->zMimetype, "text/x-markdown")==0 ){
+            markdown_to_html(&raw, 0, &content);
+          }
+
           len = (unsigned int)blob_size(&content);
         }
+
         cson_object_set(pay,"size",json_new_int((cson_int_t)len));
         cson_object_set(pay,"content",
cson_value_new_string(blob_buffer(&content),len));
         blob_reset(&content);
         blob_reset(&raw);
_______________________________________________
fossil-dev mailing list
fossil-dev@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/fossil-dev

Reply via email to