Fossil SCM

Add a configuration option that allows timeline comments to be rendered as plain text rather than as wiki.

drh 2012-11-06 00:49 trunk
Commit 90e928deeaa82ae8fa4a16f43f66addc4e327ed5
2 files changed +6 +9 -1
--- src/setup.c
+++ src/setup.c
@@ -1098,10 +1098,16 @@
10981098
onoff_attribute("Allow block-markup in timeline",
10991099
"timeline-block-markup", "tbm", 0);
11001100
@ <p>In timeline displays, check-in comments can be displayed with or
11011101
@ without block markup (paragraphs, tables, etc.)</p>
11021102
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
+
11031109
@ <hr />
11041110
onoff_attribute("Use Universal Coordinated Time (UTC)",
11051111
"timeline-utc", "utc", 1);
11061112
@ <p>Show times as UTC (also sometimes called Greenwich Mean Time (GMT) or
11071113
@ Zulu) instead of in local time. On this server, local time is currently
11081114
--- 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 @@
192192
const char *zThisUser, /* Suppress links to this user */
193193
const char *zThisTag, /* Suppress links to this tag */
194194
void (*xExtra)(int) /* Routine to call on each line of display */
195195
){
196196
int wikiFlags;
197
+ int plainText;
197198
int mxWikiLen;
198199
Blob comment;
199200
int prevTagid = 0;
200201
int suppressCnt = 0;
201202
char zPrevDate[20];
@@ -205,10 +206,11 @@
205206
Stmt fchngQuery; /* Query for file changes on check-ins */
206207
static Stmt qbranch;
207208
int pendingEndTr = 0; /* True if a </td></tr> is needed */
208209
209210
zPrevDate[0] = 0;
211
+ plainText = db_get_int("timeline-plaintext", 0);
210212
mxWikiLen = db_get_int("timeline-max-comment", 0);
211213
if( db_get_boolean("timeline-block-markup", 0) ){
212214
wikiFlags = WIKI_INLINE;
213215
}else{
214216
wikiFlags = WIKI_INLINE | WIKI_NOBLOCK;
@@ -353,12 +355,18 @@
353355
if( mxWikiLen>0 && blob_size(&comment)>mxWikiLen ){
354356
Blob truncated;
355357
blob_zero(&truncated);
356358
blob_append(&truncated, blob_buffer(&comment), mxWikiLen);
357359
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
+ }
359365
blob_reset(&truncated);
366
+ }else if( plainText ){
367
+ @ %h(blob_str(&comment));
360368
}else{
361369
wiki_convert(&comment, 0, wikiFlags);
362370
}
363371
blob_reset(&comment);
364372
365373
--- 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

Keyboard Shortcuts

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