Fossil

Check-in [0dc1187e]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Make the new wiki MIME type handling more consistent with the existing code.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | jsonWikiMimeTypes
Files: files | file ages | folders
SHA1:0dc1187e7964797108467fae162ca1f1734873fc
User & Date: mistachkin 2016-10-18 21:55:10
Context
2016-10-20
12:51
Enhancements to wiki MIME types supported for the JSON API. check-in: ce8937fa user: drh tags: trunk
2016-10-18
21:55
Make the new wiki MIME type handling more consistent with the existing code. Closed-Leaf check-in: 0dc1187e user: mistachkin tags: jsonWikiMimeTypes
08:22
Enhancements to wiki MIME types supported for the JSON API. check-in: 7a14176e user: mistachkin tags: jsonWikiMimeTypes
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/json_wiki.c.

113
114
115
116
117
118
119
120


121
122
123
124
125
126
127
128
129
                      json_new_int((cson_int_t)(zBody?strlen(zBody):0)));
    }else{
      if( contentFormat>0 ){/*HTML-ize it*/
        Blob content = empty_blob;
        Blob raw = empty_blob;
        zFormat = "html";
        if(zBody && *zBody){
          const char *zMimetype;


          blob_append(&raw,zBody,-1);
          zMimetype = wiki_filter_mimetypes(pWiki->zMimetype);
          if( fossil_strcmp(zMimetype, "text/x-fossil-wiki")==0 ){
            wiki_convert(&raw,&content,0);
          }else if( fossil_strcmp(zMimetype, "text/x-markdown")==0 ){
            markdown_to_html(&raw,0,&content);
          }else if( fossil_strcmp(zMimetype, "text/plain")==0 ){
            htmlize_to_blob(&content,blob_str(&raw),blob_size(&raw));
          }else{







|
>
>

<







113
114
115
116
117
118
119
120
121
122
123

124
125
126
127
128
129
130
                      json_new_int((cson_int_t)(zBody?strlen(zBody):0)));
    }else{
      if( contentFormat>0 ){/*HTML-ize it*/
        Blob content = empty_blob;
        Blob raw = empty_blob;
        zFormat = "html";
        if(zBody && *zBody){
          const char *zMimetype = pWiki->zMimetype;
          if( zMimetype==0 ) zMimetype = "text/plain";
          zMimetype = wiki_filter_mimetypes(zMimetype);
          blob_append(&raw,zBody,-1);

          if( fossil_strcmp(zMimetype, "text/x-fossil-wiki")==0 ){
            wiki_convert(&raw,&content,0);
          }else if( fossil_strcmp(zMimetype, "text/x-markdown")==0 ){
            markdown_to_html(&raw,0,&content);
          }else if( fossil_strcmp(zMimetype, "text/plain")==0 ){
            htmlize_to_blob(&content,blob_str(&raw),blob_size(&raw));
          }else{