246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
|
** SETTING: timeline-plaintext boolean default=off
**
** If enabled, no wiki-formatting is done for timeline comment messages.
** Hyperlinks are activated, but they show up on screen using the
** complete input text, not just the display text. No other formatting
** is done.
*/
/*
** SETTING: timeline-block-markup boolean default=off
**
** If enabled, block markup (paragraph brakes, tables, lists, headings, etc)
** is enabled while rendering check-in comment message on the timeline.
** This is disabled by default, because the timeline works best if the
** check-in comments are short and do not take up too much vertical space.
*/
/*
** SETTING: timeline-hard-newlines boolean default=off
**
** If enabled, the timeline honors newline characters in check-in comments.
** In other words, newlines are coverted into <br> for HTML display.
** The default behavior, when this setting is off, is that newlines are
** treated like any other whitespace character.
*/
/*
** Return an appropriate set of flags for wiki_convert() for displaying
** comments on a timeline. These flag settings are determined by
** configuration parameters.
**
** The altForm2 argument is true for "%!W" (with the "!" alternate-form-2
** flags) and is false for plain "%W". The ! indicates that the text is
** to be rendered on a form rather than the timeline and that block markup
** is acceptable even if the "timeline-block-markup" setting is false.
*/
int wiki_convert_flags(int altForm2){
static int wikiFlags = 0;
if( wikiFlags==0 ){
if( db_get_boolean("timeline-block-markup", 0) ){
wikiFlags = WIKI_INLINE | WIKI_NOBADLINKS;
}else{
wikiFlags = WIKI_INLINE | WIKI_NOBLOCK | WIKI_NOBADLINKS;
}
if( db_get_boolean("timeline-plaintext", 0) ){
wikiFlags |= WIKI_LINKSONLY;
}
if( db_get_boolean("timeline-hard-newlines", 0) ){
wikiFlags |= WIKI_NEWLINE;
}
}
if( altForm2 ){
/* block markup (ex: <p>, <table>) allowed */
return wikiFlags & ~WIKI_NOBLOCK;
}else{
/* Do not allow any block format. Everything in a <span> */
return wikiFlags;
}
}
/*
** The root program. All variations call this core.
**
|
<
<
<
<
<
<
<
<
|
>
|
<
>
>
>
<
|
<
<
<
<
<
<
<
<
|
<
|
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
|
** SETTING: timeline-plaintext boolean default=off
**
** If enabled, no wiki-formatting is done for timeline comment messages.
** Hyperlinks are activated, but they show up on screen using the
** complete input text, not just the display text. No other formatting
** is done.
*/
/*
** SETTING: timeline-hard-newlines boolean default=off
**
** If enabled, the timeline honors newline characters in check-in comments.
** In other words, newlines are coverted into <br> for HTML display.
** The default behavior, when this setting is off, is that newlines are
** treated like any other whitespace character.
*/
/*
** Return an appropriate set of flags for wiki_convert() for displaying
** comments on a timeline. These flag settings are determined by
** configuration parameters.
**
** The altForm2 argument is true for "%!W" (with the "!" alternate-form-2
** flags) and is false for plain "%W". The ! flag indicates that the
** formatting is for display of a check-in comment on the timeline. Such
** comments used to be renderedd differently, but ever since 2020, they
** have been rendered identially, so the ! flag does not make any different
** in the output any more.
*/
int wiki_convert_flags(int altForm2){
static int wikiFlags = 0;
(void)altForm2;
if( wikiFlags==0 ){
wikiFlags = WIKI_INLINE | WIKI_NOBADLINKS;
if( db_get_boolean("timeline-plaintext", 0) ){
wikiFlags |= WIKI_LINKSONLY;
}
if( db_get_boolean("timeline-hard-newlines", 0) ){
wikiFlags |= WIKI_NEWLINE;
}
}
return wikiFlags;
}
/*
** The root program. All variations call this core.
**
|