Fossil SCM

Merge enhancements from trunk.

drh 2020-09-10 01:08 pikchrshow merge
Commit 3f1b8862cbe97fbf328c317edd9953b4835088fd8784eb42d9738fded3e523f8
--- src/markdown_html.c
+++ src/markdown_html.c
@@ -328,11 +328,11 @@
328328
329329
/*
330330
** The nSrc bytes at zSrc[] are Pikchr input text (allegedly). Process that
331331
** text and insert the result in place of the original.
332332
*/
333
-static void fenced_code_pikchr_to_html(
333
+void pikchr_to_html(
334334
Blob *ob, /* Write the generated SVG here */
335335
const char *zSrc, int nSrc, /* The Pikchr source text */
336336
const char *zArg, int nArg /* Addition arguments */
337337
){
338338
int w = 0, h = 0;
@@ -412,11 +412,11 @@
412412
blob_appendf(ob, "<pre><code>%#h</code></pre>", n-i, z+i);
413413
}else{
414414
for(j=k+1; j<i && !fossil_isspace(z[j]); j++){}
415415
if( j-k==6 && strncmp(z+k,"pikchr",6)==0 ){
416416
while( j<i && fossil_isspace(z[j]) ){ j++; }
417
- fenced_code_pikchr_to_html(ob, z+i, n-i, z+j, i-j);
417
+ pikchr_to_html(ob, z+i, n-i, z+j, i-j);
418418
}else{
419419
blob_appendf(ob, "<pre><code class='language-%#h'>%#h</code></pre>",
420420
j-k, z+k, n-i, z+i);
421421
}
422422
}
423423
--- src/markdown_html.c
+++ src/markdown_html.c
@@ -328,11 +328,11 @@
328
329 /*
330 ** The nSrc bytes at zSrc[] are Pikchr input text (allegedly). Process that
331 ** text and insert the result in place of the original.
332 */
333 static void fenced_code_pikchr_to_html(
334 Blob *ob, /* Write the generated SVG here */
335 const char *zSrc, int nSrc, /* The Pikchr source text */
336 const char *zArg, int nArg /* Addition arguments */
337 ){
338 int w = 0, h = 0;
@@ -412,11 +412,11 @@
412 blob_appendf(ob, "<pre><code>%#h</code></pre>", n-i, z+i);
413 }else{
414 for(j=k+1; j<i && !fossil_isspace(z[j]); j++){}
415 if( j-k==6 && strncmp(z+k,"pikchr",6)==0 ){
416 while( j<i && fossil_isspace(z[j]) ){ j++; }
417 fenced_code_pikchr_to_html(ob, z+i, n-i, z+j, i-j);
418 }else{
419 blob_appendf(ob, "<pre><code class='language-%#h'>%#h</code></pre>",
420 j-k, z+k, n-i, z+i);
421 }
422 }
423
--- src/markdown_html.c
+++ src/markdown_html.c
@@ -328,11 +328,11 @@
328
329 /*
330 ** The nSrc bytes at zSrc[] are Pikchr input text (allegedly). Process that
331 ** text and insert the result in place of the original.
332 */
333 void pikchr_to_html(
334 Blob *ob, /* Write the generated SVG here */
335 const char *zSrc, int nSrc, /* The Pikchr source text */
336 const char *zArg, int nArg /* Addition arguments */
337 ){
338 int w = 0, h = 0;
@@ -412,11 +412,11 @@
412 blob_appendf(ob, "<pre><code>%#h</code></pre>", n-i, z+i);
413 }else{
414 for(j=k+1; j<i && !fossil_isspace(z[j]); j++){}
415 if( j-k==6 && strncmp(z+k,"pikchr",6)==0 ){
416 while( j<i && fossil_isspace(z[j]) ){ j++; }
417 pikchr_to_html(ob, z+i, n-i, z+j, i-j);
418 }else{
419 blob_appendf(ob, "<pre><code class='language-%#h'>%#h</code></pre>",
420 j-k, z+k, n-i, z+i);
421 }
422 }
423
+3 -2
--- src/pikchr.c
+++ src/pikchr.c
@@ -5114,11 +5114,11 @@
51145114
**
51155115
** Special color names "None" and "Off" return -1.0 without causing
51165116
** an error.
51175117
*/
51185118
static PNum pik_lookup_color(Pik *p, PToken *pId){
5119
- int first, last, mid, c;
5119
+ int first, last, mid, c = 0;
51205120
first = 0;
51215121
last = count(aColor)-1;
51225122
while( first<=last ){
51235123
const char *zClr;
51245124
int c1, c2, i;
@@ -5479,10 +5479,11 @@
54795479
** Search for object located at *pCenter that has an xChop method.
54805480
** Return a pointer to the object, or NULL if not found.
54815481
*/
54825482
static PElem *pik_find_chopper(PEList *pList, PPoint *pCenter){
54835483
int i;
5484
+ if( pList==0 ) return 0;
54845485
for(i=pList->n-1; i>=0; i--){
54855486
PElem *pElem = pList->a[i];
54865487
if( pElem->type->xChop!=0
54875488
&& pElem->ptAt.x==pCenter->x
54885489
&& pElem->ptAt.y==pCenter->y
@@ -6330,6 +6331,6 @@
63306331
printf("</body></html>\n");
63316332
return 0;
63326333
}
63336334
#endif /* PIKCHR_SHELL */
63346335
6335
-#line 6360 "pikchr.c"
6336
+#line 6361 "pikchr.c"
63366337
--- src/pikchr.c
+++ src/pikchr.c
@@ -5114,11 +5114,11 @@
5114 **
5115 ** Special color names "None" and "Off" return -1.0 without causing
5116 ** an error.
5117 */
5118 static PNum pik_lookup_color(Pik *p, PToken *pId){
5119 int first, last, mid, c;
5120 first = 0;
5121 last = count(aColor)-1;
5122 while( first<=last ){
5123 const char *zClr;
5124 int c1, c2, i;
@@ -5479,10 +5479,11 @@
5479 ** Search for object located at *pCenter that has an xChop method.
5480 ** Return a pointer to the object, or NULL if not found.
5481 */
5482 static PElem *pik_find_chopper(PEList *pList, PPoint *pCenter){
5483 int i;
 
5484 for(i=pList->n-1; i>=0; i--){
5485 PElem *pElem = pList->a[i];
5486 if( pElem->type->xChop!=0
5487 && pElem->ptAt.x==pCenter->x
5488 && pElem->ptAt.y==pCenter->y
@@ -6330,6 +6331,6 @@
6330 printf("</body></html>\n");
6331 return 0;
6332 }
6333 #endif /* PIKCHR_SHELL */
6334
6335 #line 6360 "pikchr.c"
6336
--- src/pikchr.c
+++ src/pikchr.c
@@ -5114,11 +5114,11 @@
5114 **
5115 ** Special color names "None" and "Off" return -1.0 without causing
5116 ** an error.
5117 */
5118 static PNum pik_lookup_color(Pik *p, PToken *pId){
5119 int first, last, mid, c = 0;
5120 first = 0;
5121 last = count(aColor)-1;
5122 while( first<=last ){
5123 const char *zClr;
5124 int c1, c2, i;
@@ -5479,10 +5479,11 @@
5479 ** Search for object located at *pCenter that has an xChop method.
5480 ** Return a pointer to the object, or NULL if not found.
5481 */
5482 static PElem *pik_find_chopper(PEList *pList, PPoint *pCenter){
5483 int i;
5484 if( pList==0 ) return 0;
5485 for(i=pList->n-1; i>=0; i--){
5486 PElem *pElem = pList->a[i];
5487 if( pElem->type->xChop!=0
5488 && pElem->ptAt.x==pCenter->x
5489 && pElem->ptAt.y==pCenter->y
@@ -6330,6 +6331,6 @@
6331 printf("</body></html>\n");
6332 return 0;
6333 }
6334 #endif /* PIKCHR_SHELL */
6335
6336 #line 6361 "pikchr.c"
6337
+8 -1
--- src/style.c
+++ src/style.c
@@ -552,11 +552,11 @@
552552
/*
553553
** Default HTML page header text through <body>. If the repository-specific
554554
** header template lacks a <body> tag, then all of the following is
555555
** prepended.
556556
*/
557
-static char zDfltHeader[] =
557
+static const char zDfltHeader[] =
558558
@ <html>
559559
@ <head>
560560
@ <base href="$baseurl/$current_page" />
561561
@ <meta http-equiv="Content-Security-Policy" content="$default_csp" />
562562
@ <meta name="viewport" content="width=device-width, initial-scale=1.0">
@@ -565,10 +565,17 @@
565565
@ href="$home/timeline.rss" />
566566
@ <link rel="stylesheet" href="$stylesheet_url" type="text/css" />
567567
@ </head>
568568
@ <body>
569569
;
570
+
571
+/*
572
+** Returns the default page header.
573
+*/
574
+const char *get_default_header(){
575
+ return zDfltHeader;
576
+}
570577
571578
/*
572579
** Initialize all the default TH1 variables
573580
*/
574581
static void style_init_th1_vars(const char *zTitle){
575582
--- src/style.c
+++ src/style.c
@@ -552,11 +552,11 @@
552 /*
553 ** Default HTML page header text through <body>. If the repository-specific
554 ** header template lacks a <body> tag, then all of the following is
555 ** prepended.
556 */
557 static char zDfltHeader[] =
558 @ <html>
559 @ <head>
560 @ <base href="$baseurl/$current_page" />
561 @ <meta http-equiv="Content-Security-Policy" content="$default_csp" />
562 @ <meta name="viewport" content="width=device-width, initial-scale=1.0">
@@ -565,10 +565,17 @@
565 @ href="$home/timeline.rss" />
566 @ <link rel="stylesheet" href="$stylesheet_url" type="text/css" />
567 @ </head>
568 @ <body>
569 ;
 
 
 
 
 
 
 
570
571 /*
572 ** Initialize all the default TH1 variables
573 */
574 static void style_init_th1_vars(const char *zTitle){
575
--- src/style.c
+++ src/style.c
@@ -552,11 +552,11 @@
552 /*
553 ** Default HTML page header text through <body>. If the repository-specific
554 ** header template lacks a <body> tag, then all of the following is
555 ** prepended.
556 */
557 static const char zDfltHeader[] =
558 @ <html>
559 @ <head>
560 @ <base href="$baseurl/$current_page" />
561 @ <meta http-equiv="Content-Security-Policy" content="$default_csp" />
562 @ <meta name="viewport" content="width=device-width, initial-scale=1.0">
@@ -565,10 +565,17 @@
565 @ href="$home/timeline.rss" />
566 @ <link rel="stylesheet" href="$stylesheet_url" type="text/css" />
567 @ </head>
568 @ <body>
569 ;
570
571 /*
572 ** Returns the default page header.
573 */
574 const char *get_default_header(){
575 return zDfltHeader;
576 }
577
578 /*
579 ** Initialize all the default TH1 variables
580 */
581 static void style_init_th1_vars(const char *zTitle){
582
--- src/th_main.c
+++ src/th_main.c
@@ -1345,10 +1345,29 @@
13451345
}
13461346
rc = Th_Render(argv[1]);
13471347
Th_SetResult(interp, 0, 0);
13481348
return rc;
13491349
}
1350
+
1351
+/*
1352
+** TH1 command: defHeader TITLE
1353
+**
1354
+** Returns the default page header.
1355
+*/
1356
+static int defHeaderCmd(
1357
+ Th_Interp *interp,
1358
+ void *p,
1359
+ int argc,
1360
+ const char **argv,
1361
+ int *argl
1362
+){
1363
+ if( argc!=1 ){
1364
+ return Th_WrongNumArgs(interp, "defHeader");
1365
+ }
1366
+ Th_SetResult(interp, get_default_header(), -1);
1367
+ return TH_OK;
1368
+}
13501369
13511370
/*
13521371
** TH1 command: styleHeader TITLE
13531372
**
13541373
** Render the configured style header for the selected skin.
@@ -2112,10 +2131,11 @@
21122131
{"checkout", checkoutCmd, 0},
21132132
{"combobox", comboboxCmd, 0},
21142133
{"copybtn", copybtnCmd, 0},
21152134
{"date", dateCmd, 0},
21162135
{"decorate", wikiCmd, (void*)&aFlags[2]},
2136
+ {"defHeader", defHeaderCmd, 0},
21172137
{"dir", dirCmd, 0},
21182138
{"enable_output", enableOutputCmd, 0},
21192139
{"encode64", encode64Cmd, 0},
21202140
{"getParameter", getParameterCmd, 0},
21212141
{"glob_match", globMatchCmd, 0},
21222142
--- src/th_main.c
+++ src/th_main.c
@@ -1345,10 +1345,29 @@
1345 }
1346 rc = Th_Render(argv[1]);
1347 Th_SetResult(interp, 0, 0);
1348 return rc;
1349 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1350
1351 /*
1352 ** TH1 command: styleHeader TITLE
1353 **
1354 ** Render the configured style header for the selected skin.
@@ -2112,10 +2131,11 @@
2112 {"checkout", checkoutCmd, 0},
2113 {"combobox", comboboxCmd, 0},
2114 {"copybtn", copybtnCmd, 0},
2115 {"date", dateCmd, 0},
2116 {"decorate", wikiCmd, (void*)&aFlags[2]},
 
2117 {"dir", dirCmd, 0},
2118 {"enable_output", enableOutputCmd, 0},
2119 {"encode64", encode64Cmd, 0},
2120 {"getParameter", getParameterCmd, 0},
2121 {"glob_match", globMatchCmd, 0},
2122
--- src/th_main.c
+++ src/th_main.c
@@ -1345,10 +1345,29 @@
1345 }
1346 rc = Th_Render(argv[1]);
1347 Th_SetResult(interp, 0, 0);
1348 return rc;
1349 }
1350
1351 /*
1352 ** TH1 command: defHeader TITLE
1353 **
1354 ** Returns the default page header.
1355 */
1356 static int defHeaderCmd(
1357 Th_Interp *interp,
1358 void *p,
1359 int argc,
1360 const char **argv,
1361 int *argl
1362 ){
1363 if( argc!=1 ){
1364 return Th_WrongNumArgs(interp, "defHeader");
1365 }
1366 Th_SetResult(interp, get_default_header(), -1);
1367 return TH_OK;
1368 }
1369
1370 /*
1371 ** TH1 command: styleHeader TITLE
1372 **
1373 ** Render the configured style header for the selected skin.
@@ -2112,10 +2131,11 @@
2131 {"checkout", checkoutCmd, 0},
2132 {"combobox", comboboxCmd, 0},
2133 {"copybtn", copybtnCmd, 0},
2134 {"date", dateCmd, 0},
2135 {"decorate", wikiCmd, (void*)&aFlags[2]},
2136 {"defHeader", defHeaderCmd, 0},
2137 {"dir", dirCmd, 0},
2138 {"enable_output", enableOutputCmd, 0},
2139 {"encode64", encode64Cmd, 0},
2140 {"getParameter", getParameterCmd, 0},
2141 {"glob_match", globMatchCmd, 0},
2142
+63 -6
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -1358,10 +1358,60 @@
13581358
if( p->zVerbatimId==0 ) return 1;
13591359
if( pMarkup->nAttr!=1 ) return 0;
13601360
z = pMarkup->aAttr[0].zValue;
13611361
return fossil_strcmp(z, p->zVerbatimId)==0;
13621362
}
1363
+
1364
+/*
1365
+** z[] points to the text that immediately follows markup of the form:
1366
+**
1367
+** <verbatim type='pikchr ...'>
1368
+**
1369
+** zClass is the argument to "type". This routine will process the
1370
+** Pikchr text through the next matching </verbatim> (or until end-of-file)
1371
+** and append the resulting SVG output onto p. It then returns the
1372
+** number of bytes of text processed, including the closing </verbatim>.
1373
+*/
1374
+static int wiki_process_pikchr(Renderer *p, char *z, const char *zClass){
1375
+ ParsedMarkup m; /* Parsed closing tag */
1376
+ int i = 0; /* For looping over z[] in search of </verbatim> */
1377
+ int iRet = 0; /* Value to return */
1378
+ int atEnd = 0; /* True if se have found the </verbatim> */
1379
+ int nMarkup = 0; /* Length of a markup we are checking */
1380
+
1381
+ /* Search for the closing </verbatim> tag */
1382
+ while( z[i]!=0 ){
1383
+ char *zEnd = strchr(z+i, '<');
1384
+ if( zEnd==0 ){
1385
+ i += (int)strlen(z+i);
1386
+ iRet = i;
1387
+ break;
1388
+ }
1389
+ nMarkup = html_tag_length(zEnd);
1390
+ if( nMarkup<11 || fossil_strnicmp(zEnd, "</verbatim", 10)!=0 ){
1391
+ i = (int)(zEnd - z) + 1;
1392
+ continue;
1393
+ }
1394
+ (void)parseMarkup(&m, z+i);
1395
+ atEnd = endVerbatim(p, &m);
1396
+ unparseMarkup(&m);
1397
+ if( atEnd ){
1398
+ iRet = i + nMarkup;
1399
+ break;
1400
+ }
1401
+ i++;
1402
+ }
1403
+
1404
+ /* The Pikchr source text should be i character in length and iRet is
1405
+ ** i plus the number of bytes in the </verbatim>. Generate the reply.
1406
+ */
1407
+ assert( strncmp(zClass,"pikchr",6)==0 );
1408
+ zClass += 6;
1409
+ while( fossil_isspace(zClass[0]) ) zClass++;
1410
+ pikchr_to_html(p->pOut, z, i, zClass, (int)strlen(zClass));
1411
+ return iRet;
1412
+}
13631413
13641414
/*
13651415
** Return the MUTYPE for the top of the stack.
13661416
*/
13671417
static int stackTopType(Renderer *p){
@@ -1658,30 +1708,37 @@
16581708
/* Enter <verbatim> processing. With verbatim enabled, all other
16591709
** markup other than the corresponding end-tag with the same ID is
16601710
** ignored.
16611711
*/
16621712
if( markup.iCode==MARKUP_VERBATIM ){
1663
- int ii, vAttrDidAppend=0;
1713
+ int ii; //, vAttrDidAppend=0;
1714
+ const char *zClass = 0;
16641715
p->zVerbatimId = 0;
16651716
p->inVerbatim = 1;
16661717
p->preVerbState = p->state;
16671718
p->state &= ~ALLOW_WIKI;
16681719
for(ii=0; ii<markup.nAttr; ii++){
16691720
if( markup.aAttr[ii].iACode == ATTR_ID ){
16701721
p->zVerbatimId = markup.aAttr[ii].zValue;
16711722
}else if( markup.aAttr[ii].iACode==ATTR_TYPE ){
1672
- blob_appendf(p->pOut, "<pre name='code' class='%s'>",
1673
- markup.aAttr[ii].zValue);
1674
- vAttrDidAppend=1;
1723
+ zClass = markup.aAttr[ii].zValue;
16751724
}else if( markup.aAttr[ii].iACode==ATTR_LINKS
16761725
&& !is_false(markup.aAttr[ii].zValue) ){
16771726
p->state |= ALLOW_LINKS;
16781727
}
16791728
}
1680
- if( !vAttrDidAppend ) {
1681
- endAutoParagraph(p);
1729
+ endAutoParagraph(p);
1730
+ if( zClass==0 ){
16821731
blob_append_string(p->pOut, "<pre class='verbatim'>");
1732
+ }else if( strncmp(zClass,"pikchr",6)==0 &&
1733
+ (fossil_isspace(zClass[6]) || zClass[6]==0) ){
1734
+ n += wiki_process_pikchr(p, z+n, zClass);
1735
+ p->inVerbatim = 0;
1736
+ p->state = p->preVerbState;
1737
+ }else{
1738
+ blob_appendf(p->pOut, "<pre name='code' class='%h'>",
1739
+ zClass);
16831740
}
16841741
p->wantAutoParagraph = 0;
16851742
}else
16861743
if( markup.iType==MUTYPE_LI ){
16871744
if( backupToType(p, MUTYPE_LIST)==0 ){
16881745
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -1358,10 +1358,60 @@
1358 if( p->zVerbatimId==0 ) return 1;
1359 if( pMarkup->nAttr!=1 ) return 0;
1360 z = pMarkup->aAttr[0].zValue;
1361 return fossil_strcmp(z, p->zVerbatimId)==0;
1362 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1363
1364 /*
1365 ** Return the MUTYPE for the top of the stack.
1366 */
1367 static int stackTopType(Renderer *p){
@@ -1658,30 +1708,37 @@
1658 /* Enter <verbatim> processing. With verbatim enabled, all other
1659 ** markup other than the corresponding end-tag with the same ID is
1660 ** ignored.
1661 */
1662 if( markup.iCode==MARKUP_VERBATIM ){
1663 int ii, vAttrDidAppend=0;
 
1664 p->zVerbatimId = 0;
1665 p->inVerbatim = 1;
1666 p->preVerbState = p->state;
1667 p->state &= ~ALLOW_WIKI;
1668 for(ii=0; ii<markup.nAttr; ii++){
1669 if( markup.aAttr[ii].iACode == ATTR_ID ){
1670 p->zVerbatimId = markup.aAttr[ii].zValue;
1671 }else if( markup.aAttr[ii].iACode==ATTR_TYPE ){
1672 blob_appendf(p->pOut, "<pre name='code' class='%s'>",
1673 markup.aAttr[ii].zValue);
1674 vAttrDidAppend=1;
1675 }else if( markup.aAttr[ii].iACode==ATTR_LINKS
1676 && !is_false(markup.aAttr[ii].zValue) ){
1677 p->state |= ALLOW_LINKS;
1678 }
1679 }
1680 if( !vAttrDidAppend ) {
1681 endAutoParagraph(p);
1682 blob_append_string(p->pOut, "<pre class='verbatim'>");
 
 
 
 
 
 
 
 
1683 }
1684 p->wantAutoParagraph = 0;
1685 }else
1686 if( markup.iType==MUTYPE_LI ){
1687 if( backupToType(p, MUTYPE_LIST)==0 ){
1688
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -1358,10 +1358,60 @@
1358 if( p->zVerbatimId==0 ) return 1;
1359 if( pMarkup->nAttr!=1 ) return 0;
1360 z = pMarkup->aAttr[0].zValue;
1361 return fossil_strcmp(z, p->zVerbatimId)==0;
1362 }
1363
1364 /*
1365 ** z[] points to the text that immediately follows markup of the form:
1366 **
1367 ** <verbatim type='pikchr ...'>
1368 **
1369 ** zClass is the argument to "type". This routine will process the
1370 ** Pikchr text through the next matching </verbatim> (or until end-of-file)
1371 ** and append the resulting SVG output onto p. It then returns the
1372 ** number of bytes of text processed, including the closing </verbatim>.
1373 */
1374 static int wiki_process_pikchr(Renderer *p, char *z, const char *zClass){
1375 ParsedMarkup m; /* Parsed closing tag */
1376 int i = 0; /* For looping over z[] in search of </verbatim> */
1377 int iRet = 0; /* Value to return */
1378 int atEnd = 0; /* True if se have found the </verbatim> */
1379 int nMarkup = 0; /* Length of a markup we are checking */
1380
1381 /* Search for the closing </verbatim> tag */
1382 while( z[i]!=0 ){
1383 char *zEnd = strchr(z+i, '<');
1384 if( zEnd==0 ){
1385 i += (int)strlen(z+i);
1386 iRet = i;
1387 break;
1388 }
1389 nMarkup = html_tag_length(zEnd);
1390 if( nMarkup<11 || fossil_strnicmp(zEnd, "</verbatim", 10)!=0 ){
1391 i = (int)(zEnd - z) + 1;
1392 continue;
1393 }
1394 (void)parseMarkup(&m, z+i);
1395 atEnd = endVerbatim(p, &m);
1396 unparseMarkup(&m);
1397 if( atEnd ){
1398 iRet = i + nMarkup;
1399 break;
1400 }
1401 i++;
1402 }
1403
1404 /* The Pikchr source text should be i character in length and iRet is
1405 ** i plus the number of bytes in the </verbatim>. Generate the reply.
1406 */
1407 assert( strncmp(zClass,"pikchr",6)==0 );
1408 zClass += 6;
1409 while( fossil_isspace(zClass[0]) ) zClass++;
1410 pikchr_to_html(p->pOut, z, i, zClass, (int)strlen(zClass));
1411 return iRet;
1412 }
1413
1414 /*
1415 ** Return the MUTYPE for the top of the stack.
1416 */
1417 static int stackTopType(Renderer *p){
@@ -1658,30 +1708,37 @@
1708 /* Enter <verbatim> processing. With verbatim enabled, all other
1709 ** markup other than the corresponding end-tag with the same ID is
1710 ** ignored.
1711 */
1712 if( markup.iCode==MARKUP_VERBATIM ){
1713 int ii; //, vAttrDidAppend=0;
1714 const char *zClass = 0;
1715 p->zVerbatimId = 0;
1716 p->inVerbatim = 1;
1717 p->preVerbState = p->state;
1718 p->state &= ~ALLOW_WIKI;
1719 for(ii=0; ii<markup.nAttr; ii++){
1720 if( markup.aAttr[ii].iACode == ATTR_ID ){
1721 p->zVerbatimId = markup.aAttr[ii].zValue;
1722 }else if( markup.aAttr[ii].iACode==ATTR_TYPE ){
1723 zClass = markup.aAttr[ii].zValue;
 
 
1724 }else if( markup.aAttr[ii].iACode==ATTR_LINKS
1725 && !is_false(markup.aAttr[ii].zValue) ){
1726 p->state |= ALLOW_LINKS;
1727 }
1728 }
1729 endAutoParagraph(p);
1730 if( zClass==0 ){
1731 blob_append_string(p->pOut, "<pre class='verbatim'>");
1732 }else if( strncmp(zClass,"pikchr",6)==0 &&
1733 (fossil_isspace(zClass[6]) || zClass[6]==0) ){
1734 n += wiki_process_pikchr(p, z+n, zClass);
1735 p->inVerbatim = 0;
1736 p->state = p->preVerbState;
1737 }else{
1738 blob_appendf(p->pOut, "<pre name='code' class='%h'>",
1739 zClass);
1740 }
1741 p->wantAutoParagraph = 0;
1742 }else
1743 if( markup.iType==MUTYPE_LI ){
1744 if( backupToType(p, MUTYPE_LIST)==0 ){
1745
+16 -5
--- test/th1.test
+++ test/th1.test
@@ -771,10 +771,21 @@
771771
------------------- END TRACE LOG -------------------}}
772772
}
773773
774774
###############################################################################
775775
776
+fossil test-th-eval "defHeader {Page Title Here}"
777
+test th1-defHeader-1 {$RESULT eq \
778
+ {TH_ERROR: wrong # args: should be "defHeader"}}
779
+
780
+###############################################################################
781
+
782
+fossil test-th-eval "defHeader"
783
+test th1-defHeader-2 {[string match *<body> [normalize_result]]}
784
+
785
+###############################################################################
786
+
776787
fossil test-th-eval "styleHeader {Page Title Here}"
777788
test th1-header-1 {$RESULT eq {TH_ERROR: repository unavailable}}
778789
779790
###############################################################################
780791
@@ -1036,15 +1047,15 @@
10361047
#
10371048
fossil test-th-eval "info commands"
10381049
set sorted_result [lsort $RESULT]
10391050
protOut "Sorted: $sorted_result"
10401051
set base_commands {anoncap anycap array artifact break breakpoint catch\
1041
- cgiHeaderLine checkout combobox continue copybtn date decorate dir \
1042
- enable_output encode64 error expr for getParameter glob_match \
1043
- globalState hascap hasfeature html htmlize http httpize if info \
1044
- insertCsrf lindex linecount list llength lsearch markdown nonce proc \
1045
- puts query randhex redirect regexp reinitialize rename render \
1052
+ cgiHeaderLine checkout combobox continue copybtn date decorate \
1053
+ defHeader dir enable_output encode64 error expr for getParameter \
1054
+ glob_match globalState hascap hasfeature html htmlize http httpize if \
1055
+ info insertCsrf lindex linecount list llength lsearch markdown nonce \
1056
+ proc puts query randhex redirect regexp reinitialize rename render \
10461057
repository return searchable set setParameter setting stime string \
10471058
styleFooter styleHeader styleScript tclReady trace unset unversioned \
10481059
uplevel upvar utime verifyCsrf verifyLogin wiki}
10491060
set tcl_commands {tclEval tclExpr tclInvoke tclIsSafe tclMakeSafe}
10501061
if {$th1Tcl} {
10511062
--- test/th1.test
+++ test/th1.test
@@ -771,10 +771,21 @@
771 ------------------- END TRACE LOG -------------------}}
772 }
773
774 ###############################################################################
775
 
 
 
 
 
 
 
 
 
 
 
776 fossil test-th-eval "styleHeader {Page Title Here}"
777 test th1-header-1 {$RESULT eq {TH_ERROR: repository unavailable}}
778
779 ###############################################################################
780
@@ -1036,15 +1047,15 @@
1036 #
1037 fossil test-th-eval "info commands"
1038 set sorted_result [lsort $RESULT]
1039 protOut "Sorted: $sorted_result"
1040 set base_commands {anoncap anycap array artifact break breakpoint catch\
1041 cgiHeaderLine checkout combobox continue copybtn date decorate dir \
1042 enable_output encode64 error expr for getParameter glob_match \
1043 globalState hascap hasfeature html htmlize http httpize if info \
1044 insertCsrf lindex linecount list llength lsearch markdown nonce proc \
1045 puts query randhex redirect regexp reinitialize rename render \
1046 repository return searchable set setParameter setting stime string \
1047 styleFooter styleHeader styleScript tclReady trace unset unversioned \
1048 uplevel upvar utime verifyCsrf verifyLogin wiki}
1049 set tcl_commands {tclEval tclExpr tclInvoke tclIsSafe tclMakeSafe}
1050 if {$th1Tcl} {
1051
--- test/th1.test
+++ test/th1.test
@@ -771,10 +771,21 @@
771 ------------------- END TRACE LOG -------------------}}
772 }
773
774 ###############################################################################
775
776 fossil test-th-eval "defHeader {Page Title Here}"
777 test th1-defHeader-1 {$RESULT eq \
778 {TH_ERROR: wrong # args: should be "defHeader"}}
779
780 ###############################################################################
781
782 fossil test-th-eval "defHeader"
783 test th1-defHeader-2 {[string match *<body> [normalize_result]]}
784
785 ###############################################################################
786
787 fossil test-th-eval "styleHeader {Page Title Here}"
788 test th1-header-1 {$RESULT eq {TH_ERROR: repository unavailable}}
789
790 ###############################################################################
791
@@ -1036,15 +1047,15 @@
1047 #
1048 fossil test-th-eval "info commands"
1049 set sorted_result [lsort $RESULT]
1050 protOut "Sorted: $sorted_result"
1051 set base_commands {anoncap anycap array artifact break breakpoint catch\
1052 cgiHeaderLine checkout combobox continue copybtn date decorate \
1053 defHeader dir enable_output encode64 error expr for getParameter \
1054 glob_match globalState hascap hasfeature html htmlize http httpize if \
1055 info insertCsrf lindex linecount list llength lsearch markdown nonce \
1056 proc puts query randhex redirect regexp reinitialize rename render \
1057 repository return searchable set setParameter setting stime string \
1058 styleFooter styleHeader styleScript tclReady trace unset unversioned \
1059 uplevel upvar utime verifyCsrf verifyLogin wiki}
1060 set tcl_commands {tclEval tclExpr tclInvoke tclIsSafe tclMakeSafe}
1061 if {$th1Tcl} {
1062
+8
--- www/th1.md
+++ www/th1.md
@@ -173,10 +173,11 @@
173173
* checkout
174174
* combobox
175175
* copybtn
176176
* date
177177
* decorate
178
+ * defHeader
178179
* dir
179180
* enable\_output
180181
* encode64
181182
* getParameter
182183
* glob\_match
@@ -316,10 +317,17 @@
316317
317318
* decorate STRING
318319
319320
Renders STRING as wiki content; however, only links are handled. No
320321
other markup is processed.
322
+
323
+<a name="defHeader"></a>TH1 defHeader Command
324
+---------------------------------------------
325
+
326
+ * defHeader
327
+
328
+Returns the default page header.
321329
322330
<a name="dir"></a>TH1 dir Command
323331
---------------------------------
324332
325333
* dir CHECKIN ?GLOB? ?DETAILS?
326334
--- www/th1.md
+++ www/th1.md
@@ -173,10 +173,11 @@
173 * checkout
174 * combobox
175 * copybtn
176 * date
177 * decorate
 
178 * dir
179 * enable\_output
180 * encode64
181 * getParameter
182 * glob\_match
@@ -316,10 +317,17 @@
316
317 * decorate STRING
318
319 Renders STRING as wiki content; however, only links are handled. No
320 other markup is processed.
 
 
 
 
 
 
 
321
322 <a name="dir"></a>TH1 dir Command
323 ---------------------------------
324
325 * dir CHECKIN ?GLOB? ?DETAILS?
326
--- www/th1.md
+++ www/th1.md
@@ -173,10 +173,11 @@
173 * checkout
174 * combobox
175 * copybtn
176 * date
177 * decorate
178 * defHeader
179 * dir
180 * enable\_output
181 * encode64
182 * getParameter
183 * glob\_match
@@ -316,10 +317,17 @@
317
318 * decorate STRING
319
320 Renders STRING as wiki content; however, only links are handled. No
321 other markup is processed.
322
323 <a name="defHeader"></a>TH1 defHeader Command
324 ---------------------------------------------
325
326 * defHeader
327
328 Returns the default page header.
329
330 <a name="dir"></a>TH1 dir Command
331 ---------------------------------
332
333 * dir CHECKIN ?GLOB? ?DETAILS?
334

Keyboard Shortcuts

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