Fossil SCM
Add support for Markdown in the default ticket configuration, and make Markdown the default choice for markup.
Commit
16fb915279a56a54e1766373d36e2b35f459700d7f57ebb35fa59261688dbdb8
Parent
4de1ed780c60524…
1 file changed
+14
-4
+14
-4
| --- src/tktsetup.c | ||
| +++ src/tktsetup.c | ||
| @@ -298,17 +298,19 @@ | ||
| 298 | 298 | ); |
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | static const char zDefaultNew[] = |
| 302 | 302 | @ <th1> |
| 303 | -@ if {![info exists mutype]} {set mutype {[links only]}} | |
| 303 | +@ if {![info exists mutype]} {set mutype Markdown} | |
| 304 | 304 | @ if {[info exists submit]} { |
| 305 | 305 | @ set status Open |
| 306 | 306 | @ if {$mutype eq "HTML"} { |
| 307 | 307 | @ set mimetype "text/html" |
| 308 | 308 | @ } elseif {$mutype eq "Wiki"} { |
| 309 | 309 | @ set mimetype "text/x-fossil-wiki" |
| 310 | +@ } elseif {$mutype eq "Markdown"} { | |
| 311 | +@ set mimetype text/x-markdown | |
| 310 | 312 | @ } elseif {$mutype eq {[links only]}} { |
| 311 | 313 | @ set mimetype "text/x-fossil-plain" |
| 312 | 314 | @ } else { |
| 313 | 315 | @ set mimetype "text/plain" |
| 314 | 316 | @ } |
| @@ -361,11 +363,11 @@ | ||
| 361 | 363 | @ <td colspan="3"> |
| 362 | 364 | @ Enter a detailed description of the problem. |
| 363 | 365 | @ For code defects, be sure to provide details on exactly how |
| 364 | 366 | @ the problem can be reproduced. Provide as much detail as |
| 365 | 367 | @ 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> | |
| 367 | 369 | @ <br /> |
| 368 | 370 | @ <th1>set nline [linecount $comment 50 10]</th1> |
| 369 | 371 | @ <textarea name="icomment" cols="80" rows="$nline" |
| 370 | 372 | @ wrap="virtual" class="wikiedit">$<icomment></textarea><br /> |
| 371 | 373 | @ </tr> |
| @@ -377,10 +379,12 @@ | ||
| 377 | 379 | @ if {$mutype eq "Wiki"} { |
| 378 | 380 | @ wiki $icomment |
| 379 | 381 | @ } elseif {$mutype eq "Plain Text"} { |
| 380 | 382 | @ set r [randhex] |
| 381 | 383 | @ wiki "<verbatim-$r>[string trimright $icomment]\n</verbatim-$r>" |
| 384 | +@ } elseif {$mutype eq "Markdown"} { | |
| 385 | +@ html [lindex [markdown "$icomment\n"] 1] | |
| 382 | 386 | @ } elseif {$mutype eq {[links only]}} { |
| 383 | 387 | @ set r [randhex] |
| 384 | 388 | @ wiki "<verbatim-$r links>[string trimright $icomment]\n</verbatim-$r>" |
| 385 | 389 | @ } else { |
| 386 | 390 | @ wiki "<nowiki>$icomment\n</nowiki>" |
| @@ -541,10 +545,12 @@ | ||
| 541 | 545 | @ set r [randhex] |
| 542 | 546 | @ if {$xmimetype ne "text/plain"} {html "([htmlize $xmimetype])\n"} |
| 543 | 547 | @ wiki "<verbatim-$r>[string trimright $xcomment]</verbatim-$r>\n" |
| 544 | 548 | @ } elseif {$xmimetype eq "text/x-fossil-wiki"} { |
| 545 | 549 | @ wiki "<p>\n[string trimright $xcomment]\n</p>\n" |
| 550 | +@ } elseif {$xmimetype eq "text/x-markdown"} { | |
| 551 | +@ html [lindex [markdown $xcomment] 1] | |
| 546 | 552 | @ } elseif {$xmimetype eq "text/html"} { |
| 547 | 553 | @ wiki "<p><nowiki>\n[string trimright $xcomment]\n</nowiki>\n" |
| 548 | 554 | @ } else { |
| 549 | 555 | @ set r [randhex] |
| 550 | 556 | @ wiki "<verbatim-$r links>[string trimright $xcomment]</verbatim-$r>\n" |
| @@ -583,16 +589,18 @@ | ||
| 583 | 589 | ); |
| 584 | 590 | } |
| 585 | 591 | |
| 586 | 592 | static const char zDefaultEdit[] = |
| 587 | 593 | @ <th1> |
| 588 | -@ if {![info exists mutype]} {set mutype {[links only]}} | |
| 594 | +@ if {![info exists mutype]} {set mutype Markdown} | |
| 589 | 595 | @ if {![info exists icomment]} {set icomment {}} |
| 590 | 596 | @ if {![info exists username]} {set username $login} |
| 591 | 597 | @ if {[info exists submit]} { |
| 592 | 598 | @ if {$mutype eq "Wiki"} { |
| 593 | 599 | @ set mimetype text/x-fossil-wiki |
| 600 | +@ } elseif {$mutype eq "Markdown"} { | |
| 601 | +@ set mimetype text/x-markdown | |
| 594 | 602 | @ } elseif {$mutype eq "HTML"} { |
| 595 | 603 | @ set mimetype text/html |
| 596 | 604 | @ } elseif {$mutype eq {[links only]}} { |
| 597 | 605 | @ set mimetype text/x-fossil-plain |
| 598 | 606 | @ } else { |
| @@ -642,11 +650,11 @@ | ||
| 642 | 650 | @ <input type="text" name="foundin" size="50" value="$<foundin>" /> |
| 643 | 651 | @ </td></tr> |
| 644 | 652 | @ |
| 645 | 653 | @ <tr><td colspan="2"> |
| 646 | 654 | @ 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> | |
| 648 | 656 | @ from |
| 649 | 657 | @ <input type="text" name="username" value="$<username>" size="30" />:<br /> |
| 650 | 658 | @ <textarea name="icomment" cols="80" rows="15" |
| 651 | 659 | @ wrap="virtual" class="wikiedit">$<icomment></textarea> |
| 652 | 660 | @ </td></tr> |
| @@ -658,10 +666,12 @@ | ||
| 658 | 666 | @ if {$mutype eq "Wiki"} { |
| 659 | 667 | @ wiki $icomment |
| 660 | 668 | @ } elseif {$mutype eq "Plain Text"} { |
| 661 | 669 | @ set r [randhex] |
| 662 | 670 | @ wiki "<verbatim-$r>\n[string trimright $icomment]\n</verbatim-$r>" |
| 671 | +@ } elseif {$mutype eq "Markdown"} { | |
| 672 | +@ html [lindex [markdown "$icomment\n"] 1] | |
| 663 | 673 | @ } elseif {$mutype eq {[links only]}} { |
| 664 | 674 | @ set r [randhex] |
| 665 | 675 | @ wiki "<verbatim-$r links>\n[string trimright $icomment]</verbatim-$r>" |
| 666 | 676 | @ } else { |
| 667 | 677 | @ wiki "<nowiki>\n[string trimright $icomment]\n</nowiki>" |
| 668 | 678 |
| --- 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 |