Fossil SCM

Use the new WIKI_LINKSONLY rendering option for check-in comments on the timeline when the "plain text comments" option is enabled.

drh 2012-11-22 14:03 trunk
Commit 05a53dc06f2d87fbd3449546d44ec4f4d80f2d9e
+4 -9
--- src/timeline.c
+++ src/timeline.c
@@ -193,11 +193,10 @@
193193
const char *zThisUser, /* Suppress links to this user */
194194
const char *zThisTag, /* Suppress links to this tag */
195195
void (*xExtra)(int) /* Routine to call on each line of display */
196196
){
197197
int wikiFlags;
198
- int plainText;
199198
int mxWikiLen;
200199
Blob comment;
201200
int prevTagid = 0;
202201
int suppressCnt = 0;
203202
char zPrevDate[20];
@@ -207,16 +206,18 @@
207206
Stmt fchngQuery; /* Query for file changes on check-ins */
208207
static Stmt qbranch;
209208
int pendingEndTr = 0; /* True if a </td></tr> is needed */
210209
211210
zPrevDate[0] = 0;
212
- plainText = db_get_int("timeline-plaintext", 0);
213211
mxWikiLen = db_get_int("timeline-max-comment", 0);
214212
if( db_get_boolean("timeline-block-markup", 0) ){
215213
wikiFlags = WIKI_INLINE | WIKI_NOBADLINKS;
216214
}else{
217215
wikiFlags = WIKI_INLINE | WIKI_NOBLOCK | WIKI_NOBADLINKS;
216
+ }
217
+ if( db_get_boolean("timeline-plaintext", 0) ){
218
+ wikiFlags |= WIKI_LINKSONLY;
218219
}
219220
if( tmFlags & TIMELINE_GRAPH ){
220221
pGraph = graph_init();
221222
/* style is not moved to css, because this is
222223
** a technical div for the timeline graph
@@ -357,18 +358,12 @@
357358
if( mxWikiLen>0 && blob_size(&comment)>mxWikiLen ){
358359
Blob truncated;
359360
blob_zero(&truncated);
360361
blob_append(&truncated, blob_buffer(&comment), mxWikiLen);
361362
blob_append(&truncated, "...", 3);
362
- if( plainText ){
363
- @ %h(blob_str(&truncated))
364
- }else{
365
- wiki_convert(&truncated, 0, wikiFlags);
366
- }
363
+ wiki_convert(&truncated, 0, wikiFlags);
367364
blob_reset(&truncated);
368
- }else if( plainText ){
369
- @ %h(blob_str(&comment));
370365
}else{
371366
wiki_convert(&comment, 0, wikiFlags);
372367
}
373368
blob_reset(&comment);
374369
375370
--- src/timeline.c
+++ src/timeline.c
@@ -193,11 +193,10 @@
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 plainText;
199 int mxWikiLen;
200 Blob comment;
201 int prevTagid = 0;
202 int suppressCnt = 0;
203 char zPrevDate[20];
@@ -207,16 +206,18 @@
207 Stmt fchngQuery; /* Query for file changes on check-ins */
208 static Stmt qbranch;
209 int pendingEndTr = 0; /* True if a </td></tr> is needed */
210
211 zPrevDate[0] = 0;
212 plainText = db_get_int("timeline-plaintext", 0);
213 mxWikiLen = db_get_int("timeline-max-comment", 0);
214 if( db_get_boolean("timeline-block-markup", 0) ){
215 wikiFlags = WIKI_INLINE | WIKI_NOBADLINKS;
216 }else{
217 wikiFlags = WIKI_INLINE | WIKI_NOBLOCK | WIKI_NOBADLINKS;
 
 
 
218 }
219 if( tmFlags & TIMELINE_GRAPH ){
220 pGraph = graph_init();
221 /* style is not moved to css, because this is
222 ** a technical div for the timeline graph
@@ -357,18 +358,12 @@
357 if( mxWikiLen>0 && blob_size(&comment)>mxWikiLen ){
358 Blob truncated;
359 blob_zero(&truncated);
360 blob_append(&truncated, blob_buffer(&comment), mxWikiLen);
361 blob_append(&truncated, "...", 3);
362 if( plainText ){
363 @ %h(blob_str(&truncated))
364 }else{
365 wiki_convert(&truncated, 0, wikiFlags);
366 }
367 blob_reset(&truncated);
368 }else if( plainText ){
369 @ %h(blob_str(&comment));
370 }else{
371 wiki_convert(&comment, 0, wikiFlags);
372 }
373 blob_reset(&comment);
374
375
--- src/timeline.c
+++ src/timeline.c
@@ -193,11 +193,10 @@
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,16 +206,18 @@
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 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
@@ -357,18 +358,12 @@
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
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -1635,17 +1635,15 @@
16351635
}else{
16361636
renderer.pOut = cgi_output_blob();
16371637
}
16381638
16391639
blob_strip_bom(pIn, 0);
1640
- if( flags & WIKI_LINKSONLY ) blob_append(renderer.pOut, "<pre>", 5);
16411640
wiki_render(&renderer, blob_str(pIn));
16421641
endAutoParagraph(&renderer);
16431642
while( renderer.nStack ){
16441643
popStack(&renderer);
16451644
}
1646
- if( flags & WIKI_LINKSONLY ) blob_append(renderer.pOut, "</pre>", 5);
16471645
blob_append(renderer.pOut, "\n", 1);
16481646
free(renderer.aStack);
16491647
}
16501648
16511649
/*
16521650
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -1635,17 +1635,15 @@
1635 }else{
1636 renderer.pOut = cgi_output_blob();
1637 }
1638
1639 blob_strip_bom(pIn, 0);
1640 if( flags & WIKI_LINKSONLY ) blob_append(renderer.pOut, "<pre>", 5);
1641 wiki_render(&renderer, blob_str(pIn));
1642 endAutoParagraph(&renderer);
1643 while( renderer.nStack ){
1644 popStack(&renderer);
1645 }
1646 if( flags & WIKI_LINKSONLY ) blob_append(renderer.pOut, "</pre>", 5);
1647 blob_append(renderer.pOut, "\n", 1);
1648 free(renderer.aStack);
1649 }
1650
1651 /*
1652
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -1635,17 +1635,15 @@
1635 }else{
1636 renderer.pOut = cgi_output_blob();
1637 }
1638
1639 blob_strip_bom(pIn, 0);
 
1640 wiki_render(&renderer, blob_str(pIn));
1641 endAutoParagraph(&renderer);
1642 while( renderer.nStack ){
1643 popStack(&renderer);
1644 }
 
1645 blob_append(renderer.pOut, "\n", 1);
1646 free(renderer.aStack);
1647 }
1648
1649 /*
1650

Keyboard Shortcuts

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