Fossil SCM

Add support for Markdown in the default ticket configuration, and make Markdown the default choice for markup.

drh 2019-11-20 15:25 trunk
Commit 16fb915279a56a54e1766373d36e2b35f459700d7f57ebb35fa59261688dbdb8
1 file changed +14 -4
+14 -4
--- src/tktsetup.c
+++ src/tktsetup.c
@@ -298,17 +298,19 @@
298298
);
299299
}
300300
301301
static const char zDefaultNew[] =
302302
@ <th1>
303
-@ if {![info exists mutype]} {set mutype {[links only]}}
303
+@ if {![info exists mutype]} {set mutype Markdown}
304304
@ if {[info exists submit]} {
305305
@ set status Open
306306
@ if {$mutype eq "HTML"} {
307307
@ set mimetype "text/html"
308308
@ } elseif {$mutype eq "Wiki"} {
309309
@ set mimetype "text/x-fossil-wiki"
310
+@ } elseif {$mutype eq "Markdown"} {
311
+@ set mimetype text/x-markdown
310312
@ } elseif {$mutype eq {[links only]}} {
311313
@ set mimetype "text/x-fossil-plain"
312314
@ } else {
313315
@ set mimetype "text/plain"
314316
@ }
@@ -361,11 +363,11 @@
361363
@ <td colspan="3">
362364
@ Enter a detailed description of the problem.
363365
@ For code defects, be sure to provide details on exactly how
364366
@ the problem can be reproduced. Provide as much detail as
365367
@ possible. Format:
366
-@ <th1>combobox mutype {Wiki HTML {Plain Text} {[links only]}} 1</th1>
368
+@ <th1>combobox mutype {HTML {[links only]} Markdown {Plain Text} Wiki}} 1</th1>
367369
@ <br />
368370
@ <th1>set nline [linecount $comment 50 10]</th1>
369371
@ <textarea name="icomment" cols="80" rows="$nline"
370372
@ wrap="virtual" class="wikiedit">$<icomment></textarea><br />
371373
@ </tr>
@@ -377,10 +379,12 @@
377379
@ if {$mutype eq "Wiki"} {
378380
@ wiki $icomment
379381
@ } elseif {$mutype eq "Plain Text"} {
380382
@ set r [randhex]
381383
@ wiki "<verbatim-$r>[string trimright $icomment]\n</verbatim-$r>"
384
+@ } elseif {$mutype eq "Markdown"} {
385
+@ html [lindex [markdown "$icomment\n"] 1]
382386
@ } elseif {$mutype eq {[links only]}} {
383387
@ set r [randhex]
384388
@ wiki "<verbatim-$r links>[string trimright $icomment]\n</verbatim-$r>"
385389
@ } else {
386390
@ wiki "<nowiki>$icomment\n</nowiki>"
@@ -541,10 +545,12 @@
541545
@ set r [randhex]
542546
@ if {$xmimetype ne "text/plain"} {html "([htmlize $xmimetype])\n"}
543547
@ wiki "<verbatim-$r>[string trimright $xcomment]</verbatim-$r>\n"
544548
@ } elseif {$xmimetype eq "text/x-fossil-wiki"} {
545549
@ wiki "<p>\n[string trimright $xcomment]\n</p>\n"
550
+@ } elseif {$xmimetype eq "text/x-markdown"} {
551
+@ html [lindex [markdown $xcomment] 1]
546552
@ } elseif {$xmimetype eq "text/html"} {
547553
@ wiki "<p><nowiki>\n[string trimright $xcomment]\n</nowiki>\n"
548554
@ } else {
549555
@ set r [randhex]
550556
@ wiki "<verbatim-$r links>[string trimright $xcomment]</verbatim-$r>\n"
@@ -583,16 +589,18 @@
583589
);
584590
}
585591
586592
static const char zDefaultEdit[] =
587593
@ <th1>
588
-@ if {![info exists mutype]} {set mutype {[links only]}}
594
+@ if {![info exists mutype]} {set mutype Markdown}
589595
@ if {![info exists icomment]} {set icomment {}}
590596
@ if {![info exists username]} {set username $login}
591597
@ if {[info exists submit]} {
592598
@ if {$mutype eq "Wiki"} {
593599
@ set mimetype text/x-fossil-wiki
600
+@ } elseif {$mutype eq "Markdown"} {
601
+@ set mimetype text/x-markdown
594602
@ } elseif {$mutype eq "HTML"} {
595603
@ set mimetype text/html
596604
@ } elseif {$mutype eq {[links only]}} {
597605
@ set mimetype text/x-fossil-plain
598606
@ } else {
@@ -642,11 +650,11 @@
642650
@ <input type="text" name="foundin" size="50" value="$<foundin>" />
643651
@ </td></tr>
644652
@
645653
@ <tr><td colspan="2">
646654
@ Append Remark with format
647
-@ <th1>combobox mutype {Wiki HTML {Plain Text} {[links only]}} 1</th1>
655
+@ <th1>combobox mutype {HTML {[links only]} Markdown {Plain Text} Wiki} 1</th1>
648656
@ from
649657
@ <input type="text" name="username" value="$<username>" size="30" />:<br />
650658
@ <textarea name="icomment" cols="80" rows="15"
651659
@ wrap="virtual" class="wikiedit">$<icomment></textarea>
652660
@ </td></tr>
@@ -658,10 +666,12 @@
658666
@ if {$mutype eq "Wiki"} {
659667
@ wiki $icomment
660668
@ } elseif {$mutype eq "Plain Text"} {
661669
@ set r [randhex]
662670
@ wiki "<verbatim-$r>\n[string trimright $icomment]\n</verbatim-$r>"
671
+@ } elseif {$mutype eq "Markdown"} {
672
+@ html [lindex [markdown "$icomment\n"] 1]
663673
@ } elseif {$mutype eq {[links only]}} {
664674
@ set r [randhex]
665675
@ wiki "<verbatim-$r links>\n[string trimright $icomment]</verbatim-$r>"
666676
@ } else {
667677
@ wiki "<nowiki>\n[string trimright $icomment]\n</nowiki>"
668678
--- src/tktsetup.c
+++ src/tktsetup.c
@@ -298,17 +298,19 @@
298 );
299 }
300
301 static const char zDefaultNew[] =
302 @ <th1>
303 @ if {![info exists mutype]} {set mutype {[links only]}}
304 @ if {[info exists submit]} {
305 @ set status Open
306 @ if {$mutype eq "HTML"} {
307 @ set mimetype "text/html"
308 @ } elseif {$mutype eq "Wiki"} {
309 @ set mimetype "text/x-fossil-wiki"
 
 
310 @ } elseif {$mutype eq {[links only]}} {
311 @ set mimetype "text/x-fossil-plain"
312 @ } else {
313 @ set mimetype "text/plain"
314 @ }
@@ -361,11 +363,11 @@
361 @ <td colspan="3">
362 @ Enter a detailed description of the problem.
363 @ For code defects, be sure to provide details on exactly how
364 @ the problem can be reproduced. Provide as much detail as
365 @ possible. Format:
366 @ <th1>combobox mutype {Wiki HTML {Plain Text} {[links only]}} 1</th1>
367 @ <br />
368 @ <th1>set nline [linecount $comment 50 10]</th1>
369 @ <textarea name="icomment" cols="80" rows="$nline"
370 @ wrap="virtual" class="wikiedit">$<icomment></textarea><br />
371 @ </tr>
@@ -377,10 +379,12 @@
377 @ if {$mutype eq "Wiki"} {
378 @ wiki $icomment
379 @ } elseif {$mutype eq "Plain Text"} {
380 @ set r [randhex]
381 @ wiki "<verbatim-$r>[string trimright $icomment]\n</verbatim-$r>"
 
 
382 @ } elseif {$mutype eq {[links only]}} {
383 @ set r [randhex]
384 @ wiki "<verbatim-$r links>[string trimright $icomment]\n</verbatim-$r>"
385 @ } else {
386 @ wiki "<nowiki>$icomment\n</nowiki>"
@@ -541,10 +545,12 @@
541 @ set r [randhex]
542 @ if {$xmimetype ne "text/plain"} {html "([htmlize $xmimetype])\n"}
543 @ wiki "<verbatim-$r>[string trimright $xcomment]</verbatim-$r>\n"
544 @ } elseif {$xmimetype eq "text/x-fossil-wiki"} {
545 @ wiki "<p>\n[string trimright $xcomment]\n</p>\n"
 
 
546 @ } elseif {$xmimetype eq "text/html"} {
547 @ wiki "<p><nowiki>\n[string trimright $xcomment]\n</nowiki>\n"
548 @ } else {
549 @ set r [randhex]
550 @ wiki "<verbatim-$r links>[string trimright $xcomment]</verbatim-$r>\n"
@@ -583,16 +589,18 @@
583 );
584 }
585
586 static const char zDefaultEdit[] =
587 @ <th1>
588 @ if {![info exists mutype]} {set mutype {[links only]}}
589 @ if {![info exists icomment]} {set icomment {}}
590 @ if {![info exists username]} {set username $login}
591 @ if {[info exists submit]} {
592 @ if {$mutype eq "Wiki"} {
593 @ set mimetype text/x-fossil-wiki
 
 
594 @ } elseif {$mutype eq "HTML"} {
595 @ set mimetype text/html
596 @ } elseif {$mutype eq {[links only]}} {
597 @ set mimetype text/x-fossil-plain
598 @ } else {
@@ -642,11 +650,11 @@
642 @ <input type="text" name="foundin" size="50" value="$<foundin>" />
643 @ </td></tr>
644 @
645 @ <tr><td colspan="2">
646 @ Append Remark with format
647 @ <th1>combobox mutype {Wiki HTML {Plain Text} {[links only]}} 1</th1>
648 @ from
649 @ <input type="text" name="username" value="$<username>" size="30" />:<br />
650 @ <textarea name="icomment" cols="80" rows="15"
651 @ wrap="virtual" class="wikiedit">$<icomment></textarea>
652 @ </td></tr>
@@ -658,10 +666,12 @@
658 @ if {$mutype eq "Wiki"} {
659 @ wiki $icomment
660 @ } elseif {$mutype eq "Plain Text"} {
661 @ set r [randhex]
662 @ wiki "<verbatim-$r>\n[string trimright $icomment]\n</verbatim-$r>"
 
 
663 @ } elseif {$mutype eq {[links only]}} {
664 @ set r [randhex]
665 @ wiki "<verbatim-$r links>\n[string trimright $icomment]</verbatim-$r>"
666 @ } else {
667 @ wiki "<nowiki>\n[string trimright $icomment]\n</nowiki>"
668
--- src/tktsetup.c
+++ src/tktsetup.c
@@ -298,17 +298,19 @@
298 );
299 }
300
301 static const char zDefaultNew[] =
302 @ <th1>
303 @ if {![info exists mutype]} {set mutype Markdown}
304 @ if {[info exists submit]} {
305 @ set status Open
306 @ if {$mutype eq "HTML"} {
307 @ set mimetype "text/html"
308 @ } elseif {$mutype eq "Wiki"} {
309 @ set mimetype "text/x-fossil-wiki"
310 @ } elseif {$mutype eq "Markdown"} {
311 @ set mimetype text/x-markdown
312 @ } elseif {$mutype eq {[links only]}} {
313 @ set mimetype "text/x-fossil-plain"
314 @ } else {
315 @ set mimetype "text/plain"
316 @ }
@@ -361,11 +363,11 @@
363 @ <td colspan="3">
364 @ Enter a detailed description of the problem.
365 @ For code defects, be sure to provide details on exactly how
366 @ the problem can be reproduced. Provide as much detail as
367 @ possible. Format:
368 @ <th1>combobox mutype {HTML {[links only]} Markdown {Plain Text} Wiki}} 1</th1>
369 @ <br />
370 @ <th1>set nline [linecount $comment 50 10]</th1>
371 @ <textarea name="icomment" cols="80" rows="$nline"
372 @ wrap="virtual" class="wikiedit">$<icomment></textarea><br />
373 @ </tr>
@@ -377,10 +379,12 @@
379 @ if {$mutype eq "Wiki"} {
380 @ wiki $icomment
381 @ } elseif {$mutype eq "Plain Text"} {
382 @ set r [randhex]
383 @ wiki "<verbatim-$r>[string trimright $icomment]\n</verbatim-$r>"
384 @ } elseif {$mutype eq "Markdown"} {
385 @ html [lindex [markdown "$icomment\n"] 1]
386 @ } elseif {$mutype eq {[links only]}} {
387 @ set r [randhex]
388 @ wiki "<verbatim-$r links>[string trimright $icomment]\n</verbatim-$r>"
389 @ } else {
390 @ wiki "<nowiki>$icomment\n</nowiki>"
@@ -541,10 +545,12 @@
545 @ set r [randhex]
546 @ if {$xmimetype ne "text/plain"} {html "([htmlize $xmimetype])\n"}
547 @ wiki "<verbatim-$r>[string trimright $xcomment]</verbatim-$r>\n"
548 @ } elseif {$xmimetype eq "text/x-fossil-wiki"} {
549 @ wiki "<p>\n[string trimright $xcomment]\n</p>\n"
550 @ } elseif {$xmimetype eq "text/x-markdown"} {
551 @ html [lindex [markdown $xcomment] 1]
552 @ } elseif {$xmimetype eq "text/html"} {
553 @ wiki "<p><nowiki>\n[string trimright $xcomment]\n</nowiki>\n"
554 @ } else {
555 @ set r [randhex]
556 @ wiki "<verbatim-$r links>[string trimright $xcomment]</verbatim-$r>\n"
@@ -583,16 +589,18 @@
589 );
590 }
591
592 static const char zDefaultEdit[] =
593 @ <th1>
594 @ if {![info exists mutype]} {set mutype Markdown}
595 @ if {![info exists icomment]} {set icomment {}}
596 @ if {![info exists username]} {set username $login}
597 @ if {[info exists submit]} {
598 @ if {$mutype eq "Wiki"} {
599 @ set mimetype text/x-fossil-wiki
600 @ } elseif {$mutype eq "Markdown"} {
601 @ set mimetype text/x-markdown
602 @ } elseif {$mutype eq "HTML"} {
603 @ set mimetype text/html
604 @ } elseif {$mutype eq {[links only]}} {
605 @ set mimetype text/x-fossil-plain
606 @ } else {
@@ -642,11 +650,11 @@
650 @ <input type="text" name="foundin" size="50" value="$<foundin>" />
651 @ </td></tr>
652 @
653 @ <tr><td colspan="2">
654 @ Append Remark with format
655 @ <th1>combobox mutype {HTML {[links only]} Markdown {Plain Text} Wiki} 1</th1>
656 @ from
657 @ <input type="text" name="username" value="$<username>" size="30" />:<br />
658 @ <textarea name="icomment" cols="80" rows="15"
659 @ wrap="virtual" class="wikiedit">$<icomment></textarea>
660 @ </td></tr>
@@ -658,10 +666,12 @@
666 @ if {$mutype eq "Wiki"} {
667 @ wiki $icomment
668 @ } elseif {$mutype eq "Plain Text"} {
669 @ set r [randhex]
670 @ wiki "<verbatim-$r>\n[string trimright $icomment]\n</verbatim-$r>"
671 @ } elseif {$mutype eq "Markdown"} {
672 @ html [lindex [markdown "$icomment\n"] 1]
673 @ } elseif {$mutype eq {[links only]}} {
674 @ set r [randhex]
675 @ wiki "<verbatim-$r links>\n[string trimright $icomment]</verbatim-$r>"
676 @ } else {
677 @ wiki "<nowiki>\n[string trimright $icomment]\n</nowiki>"
678

Keyboard Shortcuts

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