Fossil SCM
Be consistent about display of check-in comments as either text/plain or text/x-fossil-wiki. When the user configures text/plain, use that format everywhere.
Commit
2c6fa9c3b05788e22cca9ceafbd07134aa42996d
Parent
05a53dc06f2d87f…
7 files changed
-1
+1
+1
-1
+1
+23
-10
+2
-11
+10
-1
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -581,11 +581,10 @@ | ||
| 581 | 581 | blob_init(&prompt, zInit, -1); |
| 582 | 582 | #endif |
| 583 | 583 | blob_append(&prompt, |
| 584 | 584 | "\n" |
| 585 | 585 | "# Enter comments on this check-in. Lines beginning with # are ignored.\n" |
| 586 | - "# The check-in comment follows wiki formatting rules.\n" | |
| 587 | 586 | "#\n", -1 |
| 588 | 587 | ); |
| 589 | 588 | blob_appendf(&prompt, "# user: %s\n", zUserOvrd ? zUserOvrd : g.zLogin); |
| 590 | 589 | if( zBranch && zBranch[0] ){ |
| 591 | 590 | blob_appendf(&prompt, "# tags: %s\n#\n", zBranch); |
| 592 | 591 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -581,11 +581,10 @@ | |
| 581 | blob_init(&prompt, zInit, -1); |
| 582 | #endif |
| 583 | blob_append(&prompt, |
| 584 | "\n" |
| 585 | "# Enter comments on this check-in. Lines beginning with # are ignored.\n" |
| 586 | "# The check-in comment follows wiki formatting rules.\n" |
| 587 | "#\n", -1 |
| 588 | ); |
| 589 | blob_appendf(&prompt, "# user: %s\n", zUserOvrd ? zUserOvrd : g.zLogin); |
| 590 | if( zBranch && zBranch[0] ){ |
| 591 | blob_appendf(&prompt, "# tags: %s\n#\n", zBranch); |
| 592 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -581,11 +581,10 @@ | |
| 581 | blob_init(&prompt, zInit, -1); |
| 582 | #endif |
| 583 | blob_append(&prompt, |
| 584 | "\n" |
| 585 | "# Enter comments on this check-in. Lines beginning with # are ignored.\n" |
| 586 | "#\n", -1 |
| 587 | ); |
| 588 | blob_appendf(&prompt, "# user: %s\n", zUserOvrd ? zUserOvrd : g.zLogin); |
| 589 | if( zBranch && zBranch[0] ){ |
| 590 | blob_appendf(&prompt, "# tags: %s\n#\n", zBranch); |
| 591 |
+1
| --- src/configure.c | ||
| +++ src/configure.c | ||
| @@ -86,10 +86,11 @@ | ||
| 86 | 86 | { "background-mimetype", CONFIGSET_SKIN }, |
| 87 | 87 | { "background-image", CONFIGSET_SKIN }, |
| 88 | 88 | { "index-page", CONFIGSET_SKIN }, |
| 89 | 89 | { "timeline-block-markup", CONFIGSET_SKIN }, |
| 90 | 90 | { "timeline-max-comment", CONFIGSET_SKIN }, |
| 91 | + { "timeline-plaintext", CONFIGSET_SKIN }, | |
| 91 | 92 | { "adunit", CONFIGSET_SKIN }, |
| 92 | 93 | { "adunit-omit-if-admin", CONFIGSET_SKIN }, |
| 93 | 94 | { "adunit-omit-if-user", CONFIGSET_SKIN }, |
| 94 | 95 | { "th1-setup", CONFIGSET_ALL }, |
| 95 | 96 | |
| 96 | 97 |
| --- src/configure.c | |
| +++ src/configure.c | |
| @@ -86,10 +86,11 @@ | |
| 86 | { "background-mimetype", CONFIGSET_SKIN }, |
| 87 | { "background-image", CONFIGSET_SKIN }, |
| 88 | { "index-page", CONFIGSET_SKIN }, |
| 89 | { "timeline-block-markup", CONFIGSET_SKIN }, |
| 90 | { "timeline-max-comment", CONFIGSET_SKIN }, |
| 91 | { "adunit", CONFIGSET_SKIN }, |
| 92 | { "adunit-omit-if-admin", CONFIGSET_SKIN }, |
| 93 | { "adunit-omit-if-user", CONFIGSET_SKIN }, |
| 94 | { "th1-setup", CONFIGSET_ALL }, |
| 95 | |
| 96 |
| --- src/configure.c | |
| +++ src/configure.c | |
| @@ -86,10 +86,11 @@ | |
| 86 | { "background-mimetype", CONFIGSET_SKIN }, |
| 87 | { "background-image", CONFIGSET_SKIN }, |
| 88 | { "index-page", CONFIGSET_SKIN }, |
| 89 | { "timeline-block-markup", CONFIGSET_SKIN }, |
| 90 | { "timeline-max-comment", CONFIGSET_SKIN }, |
| 91 | { "timeline-plaintext", CONFIGSET_SKIN }, |
| 92 | { "adunit", CONFIGSET_SKIN }, |
| 93 | { "adunit-omit-if-admin", CONFIGSET_SKIN }, |
| 94 | { "adunit-omit-if-user", CONFIGSET_SKIN }, |
| 95 | { "th1-setup", CONFIGSET_ALL }, |
| 96 | |
| 97 |
+1
-1
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -2153,11 +2153,11 @@ | ||
| 2153 | 2153 | if( zNewColor && zNewColor[0] ){ |
| 2154 | 2154 | @ <tr><td style="background-color: %h(zNewColor);"> |
| 2155 | 2155 | }else{ |
| 2156 | 2156 | @ <tr><td> |
| 2157 | 2157 | } |
| 2158 | - wiki_convert(&comment, 0, WIKI_INLINE|WIKI_NOBADLINKS); | |
| 2158 | + @ %w(blob_str(&comment)) | |
| 2159 | 2159 | blob_zero(&suffix); |
| 2160 | 2160 | blob_appendf(&suffix, "(user: %h", zNewUser); |
| 2161 | 2161 | db_prepare(&q, "SELECT substr(tagname,5) FROM tagxref, tag" |
| 2162 | 2162 | " WHERE tagname GLOB 'sym-*' AND tagxref.rid=%d" |
| 2163 | 2163 | " AND tagtype>1 AND tag.tagid=tagxref.tagid", |
| 2164 | 2164 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -2153,11 +2153,11 @@ | |
| 2153 | if( zNewColor && zNewColor[0] ){ |
| 2154 | @ <tr><td style="background-color: %h(zNewColor);"> |
| 2155 | }else{ |
| 2156 | @ <tr><td> |
| 2157 | } |
| 2158 | wiki_convert(&comment, 0, WIKI_INLINE|WIKI_NOBADLINKS); |
| 2159 | blob_zero(&suffix); |
| 2160 | blob_appendf(&suffix, "(user: %h", zNewUser); |
| 2161 | db_prepare(&q, "SELECT substr(tagname,5) FROM tagxref, tag" |
| 2162 | " WHERE tagname GLOB 'sym-*' AND tagxref.rid=%d" |
| 2163 | " AND tagtype>1 AND tag.tagid=tagxref.tagid", |
| 2164 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -2153,11 +2153,11 @@ | |
| 2153 | if( zNewColor && zNewColor[0] ){ |
| 2154 | @ <tr><td style="background-color: %h(zNewColor);"> |
| 2155 | }else{ |
| 2156 | @ <tr><td> |
| 2157 | } |
| 2158 | @ %w(blob_str(&comment)) |
| 2159 | blob_zero(&suffix); |
| 2160 | blob_appendf(&suffix, "(user: %h", zNewUser); |
| 2161 | db_prepare(&q, "SELECT substr(tagname,5) FROM tagxref, tag" |
| 2162 | " WHERE tagname GLOB 'sym-*' AND tagxref.rid=%d" |
| 2163 | " AND tagtype>1 AND tag.tagid=tagxref.tagid", |
| 2164 |
+1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -152,10 +152,11 @@ | ||
| 152 | 152 | int xlinkClusterOnly; /* Set when cloning. Only process clusters */ |
| 153 | 153 | int fTimeFormat; /* 1 for UTC. 2 for localtime. 0 not yet selected */ |
| 154 | 154 | int *aCommitFile; /* Array of files to be committed */ |
| 155 | 155 | int markPrivate; /* All new artifacts are private if true */ |
| 156 | 156 | int clockSkewSeen; /* True if clocks on client and server out of sync */ |
| 157 | + int wikiFlags; /* Wiki conversion flags applied to %w and %W */ | |
| 157 | 158 | char isHTTP; /* True if server/CGI modes, else assume CLI. */ |
| 158 | 159 | char javascriptHyperlink; /* If true, set href= using script, not HTML */ |
| 159 | 160 | |
| 160 | 161 | int urlIsFile; /* True if a "file:" url */ |
| 161 | 162 | int urlIsHttps; /* True if a "https:" url */ |
| 162 | 163 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -152,10 +152,11 @@ | |
| 152 | int xlinkClusterOnly; /* Set when cloning. Only process clusters */ |
| 153 | int fTimeFormat; /* 1 for UTC. 2 for localtime. 0 not yet selected */ |
| 154 | int *aCommitFile; /* Array of files to be committed */ |
| 155 | int markPrivate; /* All new artifacts are private if true */ |
| 156 | int clockSkewSeen; /* True if clocks on client and server out of sync */ |
| 157 | char isHTTP; /* True if server/CGI modes, else assume CLI. */ |
| 158 | char javascriptHyperlink; /* If true, set href= using script, not HTML */ |
| 159 | |
| 160 | int urlIsFile; /* True if a "file:" url */ |
| 161 | int urlIsHttps; /* True if a "https:" url */ |
| 162 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -152,10 +152,11 @@ | |
| 152 | int xlinkClusterOnly; /* Set when cloning. Only process clusters */ |
| 153 | int fTimeFormat; /* 1 for UTC. 2 for localtime. 0 not yet selected */ |
| 154 | int *aCommitFile; /* Array of files to be committed */ |
| 155 | int markPrivate; /* All new artifacts are private if true */ |
| 156 | int clockSkewSeen; /* True if clocks on client and server out of sync */ |
| 157 | int wikiFlags; /* Wiki conversion flags applied to %w and %W */ |
| 158 | char isHTTP; /* True if server/CGI modes, else assume CLI. */ |
| 159 | char javascriptHyperlink; /* If true, set href= using script, not HTML */ |
| 160 | |
| 161 | int urlIsFile; /* True if a "file:" url */ |
| 162 | int urlIsHttps; /* True if a "https:" url */ |
| 163 |
+23
-10
| --- src/printf.c | ||
| +++ src/printf.c | ||
| @@ -44,12 +44,11 @@ | ||
| 44 | 44 | #define etHTMLIZE 16 /* Make text safe for HTML */ |
| 45 | 45 | #define etHTTPIZE 17 /* Make text safe for HTTP. "/" encoded as %2f */ |
| 46 | 46 | #define etURLIZE 18 /* Make text safe for HTTP. "/" not encoded */ |
| 47 | 47 | #define etFOSSILIZE 19 /* The fossil header encoding format. */ |
| 48 | 48 | #define etPATH 20 /* Path type */ |
| 49 | -#define etWIKISTR 21 /* Wiki text rendered from a char*: %w */ | |
| 50 | -#define etWIKIBLOB 22 /* Wiki text rendered from a Blob*: %W */ | |
| 49 | +#define etWIKISTR 21 /* Timeline comment text rendered from a char*: %w */ | |
| 51 | 50 | #define etSTRINGID 23 /* String with length limit for a UUID prefix: %S */ |
| 52 | 51 | #define etROOT 24 /* String value of g.zTop: % */ |
| 53 | 52 | |
| 54 | 53 | |
| 55 | 54 | /* |
| @@ -92,11 +91,10 @@ | ||
| 92 | 91 | { 'q', 0, 4, etSQLESCAPE, 0, 0 }, |
| 93 | 92 | { 'Q', 0, 4, etSQLESCAPE2, 0, 0 }, |
| 94 | 93 | { 'b', 0, 2, etBLOB, 0, 0 }, |
| 95 | 94 | { 'B', 0, 2, etBLOBSQL, 0, 0 }, |
| 96 | 95 | { 'w', 0, 2, etWIKISTR, 0, 0 }, |
| 97 | - { 'W', 0, 2, etWIKIBLOB, 0, 0 }, | |
| 98 | 96 | { 'h', 0, 4, etHTMLIZE, 0, 0 }, |
| 99 | 97 | { 'R', 0, 0, etROOT, 0, 0 }, |
| 100 | 98 | { 't', 0, 4, etHTTPIZE, 0, 0 }, /* "/" -> "%2F" */ |
| 101 | 99 | { 'T', 0, 4, etURLIZE, 0, 0 }, /* "/" unchanged */ |
| 102 | 100 | { 'F', 0, 4, etFOSSILIZE, 0, 0 }, |
| @@ -156,10 +154,31 @@ | ||
| 156 | 154 | static int StrNLen32(const char *z, int N){ |
| 157 | 155 | int n = 0; |
| 158 | 156 | while( (N-- != 0) && *(z++)!=0 ){ n++; } |
| 159 | 157 | return n; |
| 160 | 158 | } |
| 159 | + | |
| 160 | +/* | |
| 161 | +** Return an appropriate set of flags for wiki_convert() for displaying | |
| 162 | +** comments on a timeline. These flag settings are determined by | |
| 163 | +** configuration parameters. | |
| 164 | +*/ | |
| 165 | +static int wiki_convert_flags(void){ | |
| 166 | + static int wikiFlags = 0; | |
| 167 | + if( wikiFlags==0 ){ | |
| 168 | + if( db_get_boolean("timeline-block-markup", 0) ){ | |
| 169 | + wikiFlags = WIKI_INLINE | WIKI_NOBADLINKS; | |
| 170 | + }else{ | |
| 171 | + wikiFlags = WIKI_INLINE | WIKI_NOBLOCK | WIKI_NOBADLINKS; | |
| 172 | + } | |
| 173 | + if( db_get_boolean("timeline-plaintext", 0) ){ | |
| 174 | + wikiFlags |= WIKI_LINKSONLY; | |
| 175 | + } | |
| 176 | + } | |
| 177 | + return wikiFlags; | |
| 178 | +} | |
| 179 | + | |
| 161 | 180 | |
| 162 | 181 | |
| 163 | 182 | /* |
| 164 | 183 | ** The root program. All variations call this core. |
| 165 | 184 | ** |
| @@ -698,21 +717,15 @@ | ||
| 698 | 717 | case etWIKISTR: { |
| 699 | 718 | int limit = flag_alternateform ? va_arg(ap,int) : -1; |
| 700 | 719 | char *zWiki = va_arg(ap, char*); |
| 701 | 720 | Blob wiki; |
| 702 | 721 | blob_init(&wiki, zWiki, limit); |
| 703 | - wiki_convert(&wiki, pBlob, WIKI_INLINE); | |
| 722 | + wiki_convert(&wiki, pBlob, wiki_convert_flags()); | |
| 704 | 723 | blob_reset(&wiki); |
| 705 | 724 | length = width = 0; |
| 706 | 725 | break; |
| 707 | 726 | } |
| 708 | - case etWIKIBLOB: { | |
| 709 | - Blob *pWiki = va_arg(ap, Blob*); | |
| 710 | - wiki_convert(pWiki, pBlob, WIKI_INLINE); | |
| 711 | - length = width = 0; | |
| 712 | - break; | |
| 713 | - } | |
| 714 | 727 | case etERROR: |
| 715 | 728 | buf[0] = '%'; |
| 716 | 729 | buf[1] = c; |
| 717 | 730 | errorflag = 0; |
| 718 | 731 | idx = 1+(c!=0); |
| 719 | 732 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -44,12 +44,11 @@ | |
| 44 | #define etHTMLIZE 16 /* Make text safe for HTML */ |
| 45 | #define etHTTPIZE 17 /* Make text safe for HTTP. "/" encoded as %2f */ |
| 46 | #define etURLIZE 18 /* Make text safe for HTTP. "/" not encoded */ |
| 47 | #define etFOSSILIZE 19 /* The fossil header encoding format. */ |
| 48 | #define etPATH 20 /* Path type */ |
| 49 | #define etWIKISTR 21 /* Wiki text rendered from a char*: %w */ |
| 50 | #define etWIKIBLOB 22 /* Wiki text rendered from a Blob*: %W */ |
| 51 | #define etSTRINGID 23 /* String with length limit for a UUID prefix: %S */ |
| 52 | #define etROOT 24 /* String value of g.zTop: % */ |
| 53 | |
| 54 | |
| 55 | /* |
| @@ -92,11 +91,10 @@ | |
| 92 | { 'q', 0, 4, etSQLESCAPE, 0, 0 }, |
| 93 | { 'Q', 0, 4, etSQLESCAPE2, 0, 0 }, |
| 94 | { 'b', 0, 2, etBLOB, 0, 0 }, |
| 95 | { 'B', 0, 2, etBLOBSQL, 0, 0 }, |
| 96 | { 'w', 0, 2, etWIKISTR, 0, 0 }, |
| 97 | { 'W', 0, 2, etWIKIBLOB, 0, 0 }, |
| 98 | { 'h', 0, 4, etHTMLIZE, 0, 0 }, |
| 99 | { 'R', 0, 0, etROOT, 0, 0 }, |
| 100 | { 't', 0, 4, etHTTPIZE, 0, 0 }, /* "/" -> "%2F" */ |
| 101 | { 'T', 0, 4, etURLIZE, 0, 0 }, /* "/" unchanged */ |
| 102 | { 'F', 0, 4, etFOSSILIZE, 0, 0 }, |
| @@ -156,10 +154,31 @@ | |
| 156 | static int StrNLen32(const char *z, int N){ |
| 157 | int n = 0; |
| 158 | while( (N-- != 0) && *(z++)!=0 ){ n++; } |
| 159 | return n; |
| 160 | } |
| 161 | |
| 162 | |
| 163 | /* |
| 164 | ** The root program. All variations call this core. |
| 165 | ** |
| @@ -698,21 +717,15 @@ | |
| 698 | case etWIKISTR: { |
| 699 | int limit = flag_alternateform ? va_arg(ap,int) : -1; |
| 700 | char *zWiki = va_arg(ap, char*); |
| 701 | Blob wiki; |
| 702 | blob_init(&wiki, zWiki, limit); |
| 703 | wiki_convert(&wiki, pBlob, WIKI_INLINE); |
| 704 | blob_reset(&wiki); |
| 705 | length = width = 0; |
| 706 | break; |
| 707 | } |
| 708 | case etWIKIBLOB: { |
| 709 | Blob *pWiki = va_arg(ap, Blob*); |
| 710 | wiki_convert(pWiki, pBlob, WIKI_INLINE); |
| 711 | length = width = 0; |
| 712 | break; |
| 713 | } |
| 714 | case etERROR: |
| 715 | buf[0] = '%'; |
| 716 | buf[1] = c; |
| 717 | errorflag = 0; |
| 718 | idx = 1+(c!=0); |
| 719 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -44,12 +44,11 @@ | |
| 44 | #define etHTMLIZE 16 /* Make text safe for HTML */ |
| 45 | #define etHTTPIZE 17 /* Make text safe for HTTP. "/" encoded as %2f */ |
| 46 | #define etURLIZE 18 /* Make text safe for HTTP. "/" not encoded */ |
| 47 | #define etFOSSILIZE 19 /* The fossil header encoding format. */ |
| 48 | #define etPATH 20 /* Path type */ |
| 49 | #define etWIKISTR 21 /* Timeline comment text rendered from a char*: %w */ |
| 50 | #define etSTRINGID 23 /* String with length limit for a UUID prefix: %S */ |
| 51 | #define etROOT 24 /* String value of g.zTop: % */ |
| 52 | |
| 53 | |
| 54 | /* |
| @@ -92,11 +91,10 @@ | |
| 91 | { 'q', 0, 4, etSQLESCAPE, 0, 0 }, |
| 92 | { 'Q', 0, 4, etSQLESCAPE2, 0, 0 }, |
| 93 | { 'b', 0, 2, etBLOB, 0, 0 }, |
| 94 | { 'B', 0, 2, etBLOBSQL, 0, 0 }, |
| 95 | { 'w', 0, 2, etWIKISTR, 0, 0 }, |
| 96 | { 'h', 0, 4, etHTMLIZE, 0, 0 }, |
| 97 | { 'R', 0, 0, etROOT, 0, 0 }, |
| 98 | { 't', 0, 4, etHTTPIZE, 0, 0 }, /* "/" -> "%2F" */ |
| 99 | { 'T', 0, 4, etURLIZE, 0, 0 }, /* "/" unchanged */ |
| 100 | { 'F', 0, 4, etFOSSILIZE, 0, 0 }, |
| @@ -156,10 +154,31 @@ | |
| 154 | static int StrNLen32(const char *z, int N){ |
| 155 | int n = 0; |
| 156 | while( (N-- != 0) && *(z++)!=0 ){ n++; } |
| 157 | return n; |
| 158 | } |
| 159 | |
| 160 | /* |
| 161 | ** Return an appropriate set of flags for wiki_convert() for displaying |
| 162 | ** comments on a timeline. These flag settings are determined by |
| 163 | ** configuration parameters. |
| 164 | */ |
| 165 | static int wiki_convert_flags(void){ |
| 166 | static int wikiFlags = 0; |
| 167 | if( wikiFlags==0 ){ |
| 168 | if( db_get_boolean("timeline-block-markup", 0) ){ |
| 169 | wikiFlags = WIKI_INLINE | WIKI_NOBADLINKS; |
| 170 | }else{ |
| 171 | wikiFlags = WIKI_INLINE | WIKI_NOBLOCK | WIKI_NOBADLINKS; |
| 172 | } |
| 173 | if( db_get_boolean("timeline-plaintext", 0) ){ |
| 174 | wikiFlags |= WIKI_LINKSONLY; |
| 175 | } |
| 176 | } |
| 177 | return wikiFlags; |
| 178 | } |
| 179 | |
| 180 | |
| 181 | |
| 182 | /* |
| 183 | ** The root program. All variations call this core. |
| 184 | ** |
| @@ -698,21 +717,15 @@ | |
| 717 | case etWIKISTR: { |
| 718 | int limit = flag_alternateform ? va_arg(ap,int) : -1; |
| 719 | char *zWiki = va_arg(ap, char*); |
| 720 | Blob wiki; |
| 721 | blob_init(&wiki, zWiki, limit); |
| 722 | wiki_convert(&wiki, pBlob, wiki_convert_flags()); |
| 723 | blob_reset(&wiki); |
| 724 | length = width = 0; |
| 725 | break; |
| 726 | } |
| 727 | case etERROR: |
| 728 | buf[0] = '%'; |
| 729 | buf[1] = c; |
| 730 | errorflag = 0; |
| 731 | idx = 1+(c!=0); |
| 732 |
+2
-11
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -192,11 +192,10 @@ | ||
| 192 | 192 | int tmFlags, /* Flags controlling display behavior */ |
| 193 | 193 | const char *zThisUser, /* Suppress links to this user */ |
| 194 | 194 | const char *zThisTag, /* Suppress links to this tag */ |
| 195 | 195 | void (*xExtra)(int) /* Routine to call on each line of display */ |
| 196 | 196 | ){ |
| 197 | - int wikiFlags; | |
| 198 | 197 | int mxWikiLen; |
| 199 | 198 | Blob comment; |
| 200 | 199 | int prevTagid = 0; |
| 201 | 200 | int suppressCnt = 0; |
| 202 | 201 | char zPrevDate[20]; |
| @@ -207,18 +206,10 @@ | ||
| 207 | 206 | static Stmt qbranch; |
| 208 | 207 | int pendingEndTr = 0; /* True if a </td></tr> is needed */ |
| 209 | 208 | |
| 210 | 209 | zPrevDate[0] = 0; |
| 211 | 210 | mxWikiLen = db_get_int("timeline-max-comment", 0); |
| 212 | - if( db_get_boolean("timeline-block-markup", 0) ){ | |
| 213 | - wikiFlags = WIKI_INLINE | WIKI_NOBADLINKS; | |
| 214 | - }else{ | |
| 215 | - wikiFlags = WIKI_INLINE | WIKI_NOBLOCK | WIKI_NOBADLINKS; | |
| 216 | - } | |
| 217 | - if( db_get_boolean("timeline-plaintext", 0) ){ | |
| 218 | - wikiFlags |= WIKI_LINKSONLY; | |
| 219 | - } | |
| 220 | 211 | if( tmFlags & TIMELINE_GRAPH ){ |
| 221 | 212 | pGraph = graph_init(); |
| 222 | 213 | /* style is not moved to css, because this is |
| 223 | 214 | ** a technical div for the timeline graph |
| 224 | 215 | */ |
| @@ -358,14 +349,14 @@ | ||
| 358 | 349 | if( mxWikiLen>0 && blob_size(&comment)>mxWikiLen ){ |
| 359 | 350 | Blob truncated; |
| 360 | 351 | blob_zero(&truncated); |
| 361 | 352 | blob_append(&truncated, blob_buffer(&comment), mxWikiLen); |
| 362 | 353 | blob_append(&truncated, "...", 3); |
| 363 | - wiki_convert(&truncated, 0, wikiFlags); | |
| 354 | + @ %w(blob_str(&truncated)) | |
| 364 | 355 | blob_reset(&truncated); |
| 365 | 356 | }else{ |
| 366 | - wiki_convert(&comment, 0, wikiFlags); | |
| 357 | + @ %w(blob_str(&comment)) | |
| 367 | 358 | } |
| 368 | 359 | blob_reset(&comment); |
| 369 | 360 | |
| 370 | 361 | /* Generate the "user: USERNAME" at the end of the comment, together |
| 371 | 362 | ** with a hyperlink to another timeline for that user. |
| 372 | 363 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -192,11 +192,10 @@ | |
| 192 | int tmFlags, /* Flags controlling display behavior */ |
| 193 | const char *zThisUser, /* Suppress links to this user */ |
| 194 | const char *zThisTag, /* Suppress links to this tag */ |
| 195 | void (*xExtra)(int) /* Routine to call on each line of display */ |
| 196 | ){ |
| 197 | int wikiFlags; |
| 198 | int mxWikiLen; |
| 199 | Blob comment; |
| 200 | int prevTagid = 0; |
| 201 | int suppressCnt = 0; |
| 202 | char zPrevDate[20]; |
| @@ -207,18 +206,10 @@ | |
| 207 | static Stmt qbranch; |
| 208 | int pendingEndTr = 0; /* True if a </td></tr> is needed */ |
| 209 | |
| 210 | zPrevDate[0] = 0; |
| 211 | mxWikiLen = db_get_int("timeline-max-comment", 0); |
| 212 | if( db_get_boolean("timeline-block-markup", 0) ){ |
| 213 | wikiFlags = WIKI_INLINE | WIKI_NOBADLINKS; |
| 214 | }else{ |
| 215 | wikiFlags = WIKI_INLINE | WIKI_NOBLOCK | WIKI_NOBADLINKS; |
| 216 | } |
| 217 | if( db_get_boolean("timeline-plaintext", 0) ){ |
| 218 | wikiFlags |= WIKI_LINKSONLY; |
| 219 | } |
| 220 | if( tmFlags & TIMELINE_GRAPH ){ |
| 221 | pGraph = graph_init(); |
| 222 | /* style is not moved to css, because this is |
| 223 | ** a technical div for the timeline graph |
| 224 | */ |
| @@ -358,14 +349,14 @@ | |
| 358 | if( mxWikiLen>0 && blob_size(&comment)>mxWikiLen ){ |
| 359 | Blob truncated; |
| 360 | blob_zero(&truncated); |
| 361 | blob_append(&truncated, blob_buffer(&comment), mxWikiLen); |
| 362 | blob_append(&truncated, "...", 3); |
| 363 | wiki_convert(&truncated, 0, wikiFlags); |
| 364 | blob_reset(&truncated); |
| 365 | }else{ |
| 366 | wiki_convert(&comment, 0, wikiFlags); |
| 367 | } |
| 368 | blob_reset(&comment); |
| 369 | |
| 370 | /* Generate the "user: USERNAME" at the end of the comment, together |
| 371 | ** with a hyperlink to another timeline for that user. |
| 372 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -192,11 +192,10 @@ | |
| 192 | int tmFlags, /* Flags controlling display behavior */ |
| 193 | const char *zThisUser, /* Suppress links to this user */ |
| 194 | const char *zThisTag, /* Suppress links to this tag */ |
| 195 | void (*xExtra)(int) /* Routine to call on each line of display */ |
| 196 | ){ |
| 197 | int mxWikiLen; |
| 198 | Blob comment; |
| 199 | int prevTagid = 0; |
| 200 | int suppressCnt = 0; |
| 201 | char zPrevDate[20]; |
| @@ -207,18 +206,10 @@ | |
| 206 | static Stmt qbranch; |
| 207 | int pendingEndTr = 0; /* True if a </td></tr> is needed */ |
| 208 | |
| 209 | zPrevDate[0] = 0; |
| 210 | mxWikiLen = db_get_int("timeline-max-comment", 0); |
| 211 | if( tmFlags & TIMELINE_GRAPH ){ |
| 212 | pGraph = graph_init(); |
| 213 | /* style is not moved to css, because this is |
| 214 | ** a technical div for the timeline graph |
| 215 | */ |
| @@ -358,14 +349,14 @@ | |
| 349 | if( mxWikiLen>0 && blob_size(&comment)>mxWikiLen ){ |
| 350 | Blob truncated; |
| 351 | blob_zero(&truncated); |
| 352 | blob_append(&truncated, blob_buffer(&comment), mxWikiLen); |
| 353 | blob_append(&truncated, "...", 3); |
| 354 | @ %w(blob_str(&truncated)) |
| 355 | blob_reset(&truncated); |
| 356 | }else{ |
| 357 | @ %w(blob_str(&comment)) |
| 358 | } |
| 359 | blob_reset(&comment); |
| 360 | |
| 361 | /* Generate the "user: USERNAME" at the end of the comment, together |
| 362 | ** with a hyperlink to another timeline for that user. |
| 363 |
+10
| --- src/wikiformat.c | ||
| +++ src/wikiformat.c | ||
| @@ -1643,10 +1643,20 @@ | ||
| 1643 | 1643 | popStack(&renderer); |
| 1644 | 1644 | } |
| 1645 | 1645 | blob_append(renderer.pOut, "\n", 1); |
| 1646 | 1646 | free(renderer.aStack); |
| 1647 | 1647 | } |
| 1648 | + | |
| 1649 | +/* | |
| 1650 | +** Send a string as wiki to CGI output. | |
| 1651 | +*/ | |
| 1652 | +void wiki_write(const char *zIn, int flags){ | |
| 1653 | + Blob in; | |
| 1654 | + blob_init(&in, zIn, -1); | |
| 1655 | + wiki_convert(&in, 0, flags); | |
| 1656 | + blob_reset(&in); | |
| 1657 | +} | |
| 1648 | 1658 | |
| 1649 | 1659 | /* |
| 1650 | 1660 | ** COMMAND: test-wiki-render |
| 1651 | 1661 | ** |
| 1652 | 1662 | ** %fossil test-wiki-render FILE [OPTIONS] |
| 1653 | 1663 |
| --- src/wikiformat.c | |
| +++ src/wikiformat.c | |
| @@ -1643,10 +1643,20 @@ | |
| 1643 | popStack(&renderer); |
| 1644 | } |
| 1645 | blob_append(renderer.pOut, "\n", 1); |
| 1646 | free(renderer.aStack); |
| 1647 | } |
| 1648 | |
| 1649 | /* |
| 1650 | ** COMMAND: test-wiki-render |
| 1651 | ** |
| 1652 | ** %fossil test-wiki-render FILE [OPTIONS] |
| 1653 |
| --- src/wikiformat.c | |
| +++ src/wikiformat.c | |
| @@ -1643,10 +1643,20 @@ | |
| 1643 | popStack(&renderer); |
| 1644 | } |
| 1645 | blob_append(renderer.pOut, "\n", 1); |
| 1646 | free(renderer.aStack); |
| 1647 | } |
| 1648 | |
| 1649 | /* |
| 1650 | ** Send a string as wiki to CGI output. |
| 1651 | */ |
| 1652 | void wiki_write(const char *zIn, int flags){ |
| 1653 | Blob in; |
| 1654 | blob_init(&in, zIn, -1); |
| 1655 | wiki_convert(&in, 0, flags); |
| 1656 | blob_reset(&in); |
| 1657 | } |
| 1658 | |
| 1659 | /* |
| 1660 | ** COMMAND: test-wiki-render |
| 1661 | ** |
| 1662 | ** %fossil test-wiki-render FILE [OPTIONS] |
| 1663 |