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.

stephan 2020-10-07 06:59 trunk
Commit ce3046290b9825e9be3db31af908cb2f87d5436296d68d8737e73d2f3a568f02
1 file changed +5 -2
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -158,11 +158,13 @@
158158
blob_append(pOut, blob_str(&bIn), blob_size(&bIn));
159159
}else{
160160
int w = 0, h = 0;
161161
const char * zContent = blob_str(&bIn);
162162
char *zOut;
163
- zOut = pikchr(zContent, "pikchr", 0, &w, &h);
163
+ zOut = pikchr(zContent, "pikchr",
164
+ 0x01/*==>PIKCHR_PLAINTEXT_ERRORS*/,
165
+ &w, &h);
164166
if( w>0 && h>0 ){
165167
const char * zClassToggle = "";
166168
const char * zClassSource = "";
167169
const char * zWrapperClass = "";
168170
if(PIKCHR_PROCESS_DIV & pikFlags){
@@ -250,11 +252,12 @@
250252
if( !g.perm.RdWiki && !g.perm.Read && !g.perm.RdForum ){
251253
cgi_redirectf("%R/login?g=%R/pikchrshow");
252254
}
253255
zContent = PD("content",P("p"));
254256
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.*/
256259
cgi_set_content_type("text/html");
257260
if(zContent && *zContent){
258261
Blob out = empty_blob;
259262
const int isErr =
260263
pikchr_process(zContent, pikFlags, 0, &out);
261264
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button