Fossil SCM
Add a configuration option that allows timeline comments to be rendered as plain text rather than as wiki.
Commit
90e928deeaa82ae8fa4a16f43f66addc4e327ed5
Parent
cd2c0e4cb503b00…
2 files changed
+6
+9
-1
+6
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -1098,10 +1098,16 @@ | ||
| 1098 | 1098 | onoff_attribute("Allow block-markup in timeline", |
| 1099 | 1099 | "timeline-block-markup", "tbm", 0); |
| 1100 | 1100 | @ <p>In timeline displays, check-in comments can be displayed with or |
| 1101 | 1101 | @ without block markup (paragraphs, tables, etc.)</p> |
| 1102 | 1102 | |
| 1103 | + @ <hr /> | |
| 1104 | + onoff_attribute("Plaintext comments on timelines", | |
| 1105 | + "timeline-plaintext", "tpt", 0); | |
| 1106 | + @ <p>In timeline displays, check-in comments are displayed literally, | |
| 1107 | + @ without any wiki or HTML interpretation.</p> | |
| 1108 | + | |
| 1103 | 1109 | @ <hr /> |
| 1104 | 1110 | onoff_attribute("Use Universal Coordinated Time (UTC)", |
| 1105 | 1111 | "timeline-utc", "utc", 1); |
| 1106 | 1112 | @ <p>Show times as UTC (also sometimes called Greenwich Mean Time (GMT) or |
| 1107 | 1113 | @ Zulu) instead of in local time. On this server, local time is currently |
| 1108 | 1114 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -1098,10 +1098,16 @@ | |
| 1098 | onoff_attribute("Allow block-markup in timeline", |
| 1099 | "timeline-block-markup", "tbm", 0); |
| 1100 | @ <p>In timeline displays, check-in comments can be displayed with or |
| 1101 | @ without block markup (paragraphs, tables, etc.)</p> |
| 1102 | |
| 1103 | @ <hr /> |
| 1104 | onoff_attribute("Use Universal Coordinated Time (UTC)", |
| 1105 | "timeline-utc", "utc", 1); |
| 1106 | @ <p>Show times as UTC (also sometimes called Greenwich Mean Time (GMT) or |
| 1107 | @ Zulu) instead of in local time. On this server, local time is currently |
| 1108 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -1098,10 +1098,16 @@ | |
| 1098 | onoff_attribute("Allow block-markup in timeline", |
| 1099 | "timeline-block-markup", "tbm", 0); |
| 1100 | @ <p>In timeline displays, check-in comments can be displayed with or |
| 1101 | @ without block markup (paragraphs, tables, etc.)</p> |
| 1102 | |
| 1103 | @ <hr /> |
| 1104 | onoff_attribute("Plaintext comments on timelines", |
| 1105 | "timeline-plaintext", "tpt", 0); |
| 1106 | @ <p>In timeline displays, check-in comments are displayed literally, |
| 1107 | @ without any wiki or HTML interpretation.</p> |
| 1108 | |
| 1109 | @ <hr /> |
| 1110 | onoff_attribute("Use Universal Coordinated Time (UTC)", |
| 1111 | "timeline-utc", "utc", 1); |
| 1112 | @ <p>Show times as UTC (also sometimes called Greenwich Mean Time (GMT) or |
| 1113 | @ Zulu) instead of in local time. On this server, local time is currently |
| 1114 |
+9
-1
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -192,10 +192,11 @@ | ||
| 192 | 192 | const char *zThisUser, /* Suppress links to this user */ |
| 193 | 193 | const char *zThisTag, /* Suppress links to this tag */ |
| 194 | 194 | void (*xExtra)(int) /* Routine to call on each line of display */ |
| 195 | 195 | ){ |
| 196 | 196 | int wikiFlags; |
| 197 | + int plainText; | |
| 197 | 198 | int mxWikiLen; |
| 198 | 199 | Blob comment; |
| 199 | 200 | int prevTagid = 0; |
| 200 | 201 | int suppressCnt = 0; |
| 201 | 202 | char zPrevDate[20]; |
| @@ -205,10 +206,11 @@ | ||
| 205 | 206 | Stmt fchngQuery; /* Query for file changes on check-ins */ |
| 206 | 207 | static Stmt qbranch; |
| 207 | 208 | int pendingEndTr = 0; /* True if a </td></tr> is needed */ |
| 208 | 209 | |
| 209 | 210 | zPrevDate[0] = 0; |
| 211 | + plainText = db_get_int("timeline-plaintext", 0); | |
| 210 | 212 | mxWikiLen = db_get_int("timeline-max-comment", 0); |
| 211 | 213 | if( db_get_boolean("timeline-block-markup", 0) ){ |
| 212 | 214 | wikiFlags = WIKI_INLINE; |
| 213 | 215 | }else{ |
| 214 | 216 | wikiFlags = WIKI_INLINE | WIKI_NOBLOCK; |
| @@ -353,12 +355,18 @@ | ||
| 353 | 355 | if( mxWikiLen>0 && blob_size(&comment)>mxWikiLen ){ |
| 354 | 356 | Blob truncated; |
| 355 | 357 | blob_zero(&truncated); |
| 356 | 358 | blob_append(&truncated, blob_buffer(&comment), mxWikiLen); |
| 357 | 359 | blob_append(&truncated, "...", 3); |
| 358 | - wiki_convert(&truncated, 0, wikiFlags); | |
| 360 | + if( plainText ){ | |
| 361 | + @ %h(blob_str(&truncated)) | |
| 362 | + }else{ | |
| 363 | + wiki_convert(&truncated, 0, wikiFlags); | |
| 364 | + } | |
| 359 | 365 | blob_reset(&truncated); |
| 366 | + }else if( plainText ){ | |
| 367 | + @ %h(blob_str(&comment)); | |
| 360 | 368 | }else{ |
| 361 | 369 | wiki_convert(&comment, 0, wikiFlags); |
| 362 | 370 | } |
| 363 | 371 | blob_reset(&comment); |
| 364 | 372 | |
| 365 | 373 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -192,10 +192,11 @@ | |
| 192 | const char *zThisUser, /* Suppress links to this user */ |
| 193 | const char *zThisTag, /* Suppress links to this tag */ |
| 194 | void (*xExtra)(int) /* Routine to call on each line of display */ |
| 195 | ){ |
| 196 | int wikiFlags; |
| 197 | int mxWikiLen; |
| 198 | Blob comment; |
| 199 | int prevTagid = 0; |
| 200 | int suppressCnt = 0; |
| 201 | char zPrevDate[20]; |
| @@ -205,10 +206,11 @@ | |
| 205 | Stmt fchngQuery; /* Query for file changes on check-ins */ |
| 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( db_get_boolean("timeline-block-markup", 0) ){ |
| 212 | wikiFlags = WIKI_INLINE; |
| 213 | }else{ |
| 214 | wikiFlags = WIKI_INLINE | WIKI_NOBLOCK; |
| @@ -353,12 +355,18 @@ | |
| 353 | if( mxWikiLen>0 && blob_size(&comment)>mxWikiLen ){ |
| 354 | Blob truncated; |
| 355 | blob_zero(&truncated); |
| 356 | blob_append(&truncated, blob_buffer(&comment), mxWikiLen); |
| 357 | blob_append(&truncated, "...", 3); |
| 358 | wiki_convert(&truncated, 0, wikiFlags); |
| 359 | blob_reset(&truncated); |
| 360 | }else{ |
| 361 | wiki_convert(&comment, 0, wikiFlags); |
| 362 | } |
| 363 | blob_reset(&comment); |
| 364 | |
| 365 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -192,10 +192,11 @@ | |
| 192 | const char *zThisUser, /* Suppress links to this user */ |
| 193 | const char *zThisTag, /* Suppress links to this tag */ |
| 194 | void (*xExtra)(int) /* Routine to call on each line of display */ |
| 195 | ){ |
| 196 | int wikiFlags; |
| 197 | int plainText; |
| 198 | int mxWikiLen; |
| 199 | Blob comment; |
| 200 | int prevTagid = 0; |
| 201 | int suppressCnt = 0; |
| 202 | char zPrevDate[20]; |
| @@ -205,10 +206,11 @@ | |
| 206 | Stmt fchngQuery; /* Query for file changes on check-ins */ |
| 207 | static Stmt qbranch; |
| 208 | int pendingEndTr = 0; /* True if a </td></tr> is needed */ |
| 209 | |
| 210 | zPrevDate[0] = 0; |
| 211 | plainText = db_get_int("timeline-plaintext", 0); |
| 212 | mxWikiLen = db_get_int("timeline-max-comment", 0); |
| 213 | if( db_get_boolean("timeline-block-markup", 0) ){ |
| 214 | wikiFlags = WIKI_INLINE; |
| 215 | }else{ |
| 216 | wikiFlags = WIKI_INLINE | WIKI_NOBLOCK; |
| @@ -353,12 +355,18 @@ | |
| 355 | if( mxWikiLen>0 && blob_size(&comment)>mxWikiLen ){ |
| 356 | Blob truncated; |
| 357 | blob_zero(&truncated); |
| 358 | blob_append(&truncated, blob_buffer(&comment), mxWikiLen); |
| 359 | blob_append(&truncated, "...", 3); |
| 360 | if( plainText ){ |
| 361 | @ %h(blob_str(&truncated)) |
| 362 | }else{ |
| 363 | wiki_convert(&truncated, 0, wikiFlags); |
| 364 | } |
| 365 | blob_reset(&truncated); |
| 366 | }else if( plainText ){ |
| 367 | @ %h(blob_str(&comment)); |
| 368 | }else{ |
| 369 | wiki_convert(&comment, 0, wikiFlags); |
| 370 | } |
| 371 | blob_reset(&comment); |
| 372 | |
| 373 |