Fossil SCM
Use the new WIKI_LINKSONLY rendering option for check-in comments on the timeline when the "plain text comments" option is enabled.
Commit
05a53dc06f2d87fbd3449546d44ec4f4d80f2d9e
Parent
a191d8fb7661b09…
2 files changed
+4
-9
-2
+4
-9
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -193,11 +193,10 @@ | ||
| 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 | 197 | int wikiFlags; |
| 198 | - int plainText; | |
| 199 | 198 | int mxWikiLen; |
| 200 | 199 | Blob comment; |
| 201 | 200 | int prevTagid = 0; |
| 202 | 201 | int suppressCnt = 0; |
| 203 | 202 | char zPrevDate[20]; |
| @@ -207,16 +206,18 @@ | ||
| 207 | 206 | Stmt fchngQuery; /* Query for file changes on check-ins */ |
| 208 | 207 | static Stmt qbranch; |
| 209 | 208 | int pendingEndTr = 0; /* True if a </td></tr> is needed */ |
| 210 | 209 | |
| 211 | 210 | zPrevDate[0] = 0; |
| 212 | - plainText = db_get_int("timeline-plaintext", 0); | |
| 213 | 211 | mxWikiLen = db_get_int("timeline-max-comment", 0); |
| 214 | 212 | if( db_get_boolean("timeline-block-markup", 0) ){ |
| 215 | 213 | wikiFlags = WIKI_INLINE | WIKI_NOBADLINKS; |
| 216 | 214 | }else{ |
| 217 | 215 | wikiFlags = WIKI_INLINE | WIKI_NOBLOCK | WIKI_NOBADLINKS; |
| 216 | + } | |
| 217 | + if( db_get_boolean("timeline-plaintext", 0) ){ | |
| 218 | + wikiFlags |= WIKI_LINKSONLY; | |
| 218 | 219 | } |
| 219 | 220 | if( tmFlags & TIMELINE_GRAPH ){ |
| 220 | 221 | pGraph = graph_init(); |
| 221 | 222 | /* style is not moved to css, because this is |
| 222 | 223 | ** a technical div for the timeline graph |
| @@ -357,18 +358,12 @@ | ||
| 357 | 358 | if( mxWikiLen>0 && blob_size(&comment)>mxWikiLen ){ |
| 358 | 359 | Blob truncated; |
| 359 | 360 | blob_zero(&truncated); |
| 360 | 361 | blob_append(&truncated, blob_buffer(&comment), mxWikiLen); |
| 361 | 362 | 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); | |
| 367 | 364 | blob_reset(&truncated); |
| 368 | - }else if( plainText ){ | |
| 369 | - @ %h(blob_str(&comment)); | |
| 370 | 365 | }else{ |
| 371 | 366 | wiki_convert(&comment, 0, wikiFlags); |
| 372 | 367 | } |
| 373 | 368 | blob_reset(&comment); |
| 374 | 369 | |
| 375 | 370 |
| --- 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 |
-2
| --- src/wikiformat.c | ||
| +++ src/wikiformat.c | ||
| @@ -1635,17 +1635,15 @@ | ||
| 1635 | 1635 | }else{ |
| 1636 | 1636 | renderer.pOut = cgi_output_blob(); |
| 1637 | 1637 | } |
| 1638 | 1638 | |
| 1639 | 1639 | blob_strip_bom(pIn, 0); |
| 1640 | - if( flags & WIKI_LINKSONLY ) blob_append(renderer.pOut, "<pre>", 5); | |
| 1641 | 1640 | wiki_render(&renderer, blob_str(pIn)); |
| 1642 | 1641 | endAutoParagraph(&renderer); |
| 1643 | 1642 | while( renderer.nStack ){ |
| 1644 | 1643 | popStack(&renderer); |
| 1645 | 1644 | } |
| 1646 | - if( flags & WIKI_LINKSONLY ) blob_append(renderer.pOut, "</pre>", 5); | |
| 1647 | 1645 | blob_append(renderer.pOut, "\n", 1); |
| 1648 | 1646 | free(renderer.aStack); |
| 1649 | 1647 | } |
| 1650 | 1648 | |
| 1651 | 1649 | /* |
| 1652 | 1650 |
| --- 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 |