Fossil SCM
pikchr_process() now makes use of the as-yet-not-public PIKCHR_PLAINTEXT_ERRORS flag to maintain control of the error output DOM structure.
Commit
ce3046290b9825e9be3db31af908cb2f87d5436296d68d8737e73d2f3a568f02
Parent
da1ff5c2d1037b3…
1 file changed
+5
-2
+5
-2
| --- src/pikchrshow.c | ||
| +++ src/pikchrshow.c | ||
| @@ -158,11 +158,13 @@ | ||
| 158 | 158 | blob_append(pOut, blob_str(&bIn), blob_size(&bIn)); |
| 159 | 159 | }else{ |
| 160 | 160 | int w = 0, h = 0; |
| 161 | 161 | const char * zContent = blob_str(&bIn); |
| 162 | 162 | char *zOut; |
| 163 | - zOut = pikchr(zContent, "pikchr", 0, &w, &h); | |
| 163 | + zOut = pikchr(zContent, "pikchr", | |
| 164 | + 0x01/*==>PIKCHR_PLAINTEXT_ERRORS*/, | |
| 165 | + &w, &h); | |
| 164 | 166 | if( w>0 && h>0 ){ |
| 165 | 167 | const char * zClassToggle = ""; |
| 166 | 168 | const char * zClassSource = ""; |
| 167 | 169 | const char * zWrapperClass = ""; |
| 168 | 170 | if(PIKCHR_PROCESS_DIV & pikFlags){ |
| @@ -250,11 +252,12 @@ | ||
| 250 | 252 | if( !g.perm.RdWiki && !g.perm.Read && !g.perm.RdForum ){ |
| 251 | 253 | cgi_redirectf("%R/login?g=%R/pikchrshow"); |
| 252 | 254 | } |
| 253 | 255 | zContent = PD("content",P("p")); |
| 254 | 256 | if(P("ajax")!=0){ |
| 255 | - /* Called from the JS-side preview updater. */ | |
| 257 | + /* Called from the JS-side preview updater. | |
| 258 | + TODO: respond with JSON instead.*/ | |
| 256 | 259 | cgi_set_content_type("text/html"); |
| 257 | 260 | if(zContent && *zContent){ |
| 258 | 261 | Blob out = empty_blob; |
| 259 | 262 | const int isErr = |
| 260 | 263 | pikchr_process(zContent, pikFlags, 0, &out); |
| 261 | 264 |
| --- src/pikchrshow.c | |
| +++ src/pikchrshow.c | |
| @@ -158,11 +158,13 @@ | |
| 158 | blob_append(pOut, blob_str(&bIn), blob_size(&bIn)); |
| 159 | }else{ |
| 160 | int w = 0, h = 0; |
| 161 | const char * zContent = blob_str(&bIn); |
| 162 | char *zOut; |
| 163 | zOut = pikchr(zContent, "pikchr", 0, &w, &h); |
| 164 | if( w>0 && h>0 ){ |
| 165 | const char * zClassToggle = ""; |
| 166 | const char * zClassSource = ""; |
| 167 | const char * zWrapperClass = ""; |
| 168 | if(PIKCHR_PROCESS_DIV & pikFlags){ |
| @@ -250,11 +252,12 @@ | |
| 250 | if( !g.perm.RdWiki && !g.perm.Read && !g.perm.RdForum ){ |
| 251 | cgi_redirectf("%R/login?g=%R/pikchrshow"); |
| 252 | } |
| 253 | zContent = PD("content",P("p")); |
| 254 | if(P("ajax")!=0){ |
| 255 | /* Called from the JS-side preview updater. */ |
| 256 | cgi_set_content_type("text/html"); |
| 257 | if(zContent && *zContent){ |
| 258 | Blob out = empty_blob; |
| 259 | const int isErr = |
| 260 | pikchr_process(zContent, pikFlags, 0, &out); |
| 261 |
| --- src/pikchrshow.c | |
| +++ src/pikchrshow.c | |
| @@ -158,11 +158,13 @@ | |
| 158 | blob_append(pOut, blob_str(&bIn), blob_size(&bIn)); |
| 159 | }else{ |
| 160 | int w = 0, h = 0; |
| 161 | const char * zContent = blob_str(&bIn); |
| 162 | char *zOut; |
| 163 | zOut = pikchr(zContent, "pikchr", |
| 164 | 0x01/*==>PIKCHR_PLAINTEXT_ERRORS*/, |
| 165 | &w, &h); |
| 166 | if( w>0 && h>0 ){ |
| 167 | const char * zClassToggle = ""; |
| 168 | const char * zClassSource = ""; |
| 169 | const char * zWrapperClass = ""; |
| 170 | if(PIKCHR_PROCESS_DIV & pikFlags){ |
| @@ -250,11 +252,12 @@ | |
| 252 | if( !g.perm.RdWiki && !g.perm.Read && !g.perm.RdForum ){ |
| 253 | cgi_redirectf("%R/login?g=%R/pikchrshow"); |
| 254 | } |
| 255 | zContent = PD("content",P("p")); |
| 256 | if(P("ajax")!=0){ |
| 257 | /* Called from the JS-side preview updater. |
| 258 | TODO: respond with JSON instead.*/ |
| 259 | cgi_set_content_type("text/html"); |
| 260 | if(zContent && *zContent){ |
| 261 | Blob out = empty_blob; |
| 262 | const int isErr = |
| 263 | pikchr_process(zContent, pikFlags, 0, &out); |
| 264 |