Fossil SCM
Change the default markup language for Forum to Markdown.
Commit
5f3cb278fdb0ac3f42d31bda1754139092e2c4cc805bfc0369f7297ed2706049
Parent
38638cfcdd18f4b…
1 file changed
+8
-3
+8
-3
| --- src/forum.c | ||
| +++ src/forum.c | ||
| @@ -19,10 +19,15 @@ | ||
| 19 | 19 | */ |
| 20 | 20 | #include "config.h" |
| 21 | 21 | #include <assert.h> |
| 22 | 22 | #include "forum.h" |
| 23 | 23 | |
| 24 | +/* | |
| 25 | +** Default to using Markdown markup | |
| 26 | +*/ | |
| 27 | +#define DEFAULT_FORUM_MIMETYPE "text/x-markdown" | |
| 28 | + | |
| 24 | 29 | #if INTERFACE |
| 25 | 30 | /* |
| 26 | 31 | ** Each instance of the following object represents a single message - |
| 27 | 32 | ** either the initial post, an edit to a post, a reply, or an edit to |
| 28 | 33 | ** a reply. |
| @@ -705,11 +710,11 @@ | ||
| 705 | 710 | ** |
| 706 | 711 | ** Start a new forum thread. |
| 707 | 712 | */ |
| 708 | 713 | void forumnew_page(void){ |
| 709 | 714 | const char *zTitle = PDT("title",""); |
| 710 | - const char *zMimetype = PD("mimetype","text/x-fossil-wiki"); | |
| 715 | + const char *zMimetype = PD("mimetype",DEFAULT_FORUM_MIMETYPE); | |
| 711 | 716 | const char *zContent = PDT("content",""); |
| 712 | 717 | login_check_credentials(); |
| 713 | 718 | if( !g.perm.WrForum ){ |
| 714 | 719 | login_needed(g.anon.WrForum); |
| 715 | 720 | return; |
| @@ -801,11 +806,11 @@ | ||
| 801 | 806 | } |
| 802 | 807 | } |
| 803 | 808 | isDelete = P("nullout")!=0; |
| 804 | 809 | if( P("submit") && isCsrfSafe ){ |
| 805 | 810 | int done = 1; |
| 806 | - const char *zMimetype = PD("mimetype","text/x-fossil-wiki"); | |
| 811 | + const char *zMimetype = PD("mimetype",DEFAULT_FORUM_MIMETYPE); | |
| 807 | 812 | const char *zContent = PDT("content",""); |
| 808 | 813 | if( P("reply") ){ |
| 809 | 814 | done = forum_post(0, fpid, 0, 0, zMimetype, zContent); |
| 810 | 815 | }else if( P("edit") || isDelete ){ |
| 811 | 816 | done = forum_post(P("title"), 0, fpid, 0, zMimetype, zContent); |
| @@ -856,11 +861,11 @@ | ||
| 856 | 861 | @ <input type="hidden" name="edit" value="1"> |
| 857 | 862 | forum_from_line(); |
| 858 | 863 | forum_entry_widget(zTitle, zMimetype, zContent); |
| 859 | 864 | }else{ |
| 860 | 865 | /* Reply */ |
| 861 | - zMimetype = PD("mimetype","text/x-fossil-wiki"); | |
| 866 | + zMimetype = PD("mimetype",DEFAULT_FORUM_MIMETYPE); | |
| 862 | 867 | zContent = PDT("content",""); |
| 863 | 868 | style_header("Reply"); |
| 864 | 869 | @ <h1>Replying To:</h1> |
| 865 | 870 | forum_render(0, pPost->zMimetype, pPost->zWiki, "forumEdit"); |
| 866 | 871 | if( P("preview") ){ |
| 867 | 872 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -19,10 +19,15 @@ | |
| 19 | */ |
| 20 | #include "config.h" |
| 21 | #include <assert.h> |
| 22 | #include "forum.h" |
| 23 | |
| 24 | #if INTERFACE |
| 25 | /* |
| 26 | ** Each instance of the following object represents a single message - |
| 27 | ** either the initial post, an edit to a post, a reply, or an edit to |
| 28 | ** a reply. |
| @@ -705,11 +710,11 @@ | |
| 705 | ** |
| 706 | ** Start a new forum thread. |
| 707 | */ |
| 708 | void forumnew_page(void){ |
| 709 | const char *zTitle = PDT("title",""); |
| 710 | const char *zMimetype = PD("mimetype","text/x-fossil-wiki"); |
| 711 | const char *zContent = PDT("content",""); |
| 712 | login_check_credentials(); |
| 713 | if( !g.perm.WrForum ){ |
| 714 | login_needed(g.anon.WrForum); |
| 715 | return; |
| @@ -801,11 +806,11 @@ | |
| 801 | } |
| 802 | } |
| 803 | isDelete = P("nullout")!=0; |
| 804 | if( P("submit") && isCsrfSafe ){ |
| 805 | int done = 1; |
| 806 | const char *zMimetype = PD("mimetype","text/x-fossil-wiki"); |
| 807 | const char *zContent = PDT("content",""); |
| 808 | if( P("reply") ){ |
| 809 | done = forum_post(0, fpid, 0, 0, zMimetype, zContent); |
| 810 | }else if( P("edit") || isDelete ){ |
| 811 | done = forum_post(P("title"), 0, fpid, 0, zMimetype, zContent); |
| @@ -856,11 +861,11 @@ | |
| 856 | @ <input type="hidden" name="edit" value="1"> |
| 857 | forum_from_line(); |
| 858 | forum_entry_widget(zTitle, zMimetype, zContent); |
| 859 | }else{ |
| 860 | /* Reply */ |
| 861 | zMimetype = PD("mimetype","text/x-fossil-wiki"); |
| 862 | zContent = PDT("content",""); |
| 863 | style_header("Reply"); |
| 864 | @ <h1>Replying To:</h1> |
| 865 | forum_render(0, pPost->zMimetype, pPost->zWiki, "forumEdit"); |
| 866 | if( P("preview") ){ |
| 867 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -19,10 +19,15 @@ | |
| 19 | */ |
| 20 | #include "config.h" |
| 21 | #include <assert.h> |
| 22 | #include "forum.h" |
| 23 | |
| 24 | /* |
| 25 | ** Default to using Markdown markup |
| 26 | */ |
| 27 | #define DEFAULT_FORUM_MIMETYPE "text/x-markdown" |
| 28 | |
| 29 | #if INTERFACE |
| 30 | /* |
| 31 | ** Each instance of the following object represents a single message - |
| 32 | ** either the initial post, an edit to a post, a reply, or an edit to |
| 33 | ** a reply. |
| @@ -705,11 +710,11 @@ | |
| 710 | ** |
| 711 | ** Start a new forum thread. |
| 712 | */ |
| 713 | void forumnew_page(void){ |
| 714 | const char *zTitle = PDT("title",""); |
| 715 | const char *zMimetype = PD("mimetype",DEFAULT_FORUM_MIMETYPE); |
| 716 | const char *zContent = PDT("content",""); |
| 717 | login_check_credentials(); |
| 718 | if( !g.perm.WrForum ){ |
| 719 | login_needed(g.anon.WrForum); |
| 720 | return; |
| @@ -801,11 +806,11 @@ | |
| 806 | } |
| 807 | } |
| 808 | isDelete = P("nullout")!=0; |
| 809 | if( P("submit") && isCsrfSafe ){ |
| 810 | int done = 1; |
| 811 | const char *zMimetype = PD("mimetype",DEFAULT_FORUM_MIMETYPE); |
| 812 | const char *zContent = PDT("content",""); |
| 813 | if( P("reply") ){ |
| 814 | done = forum_post(0, fpid, 0, 0, zMimetype, zContent); |
| 815 | }else if( P("edit") || isDelete ){ |
| 816 | done = forum_post(P("title"), 0, fpid, 0, zMimetype, zContent); |
| @@ -856,11 +861,11 @@ | |
| 861 | @ <input type="hidden" name="edit" value="1"> |
| 862 | forum_from_line(); |
| 863 | forum_entry_widget(zTitle, zMimetype, zContent); |
| 864 | }else{ |
| 865 | /* Reply */ |
| 866 | zMimetype = PD("mimetype",DEFAULT_FORUM_MIMETYPE); |
| 867 | zContent = PDT("content",""); |
| 868 | style_header("Reply"); |
| 869 | @ <h1>Replying To:</h1> |
| 870 | forum_render(0, pPost->zMimetype, pPost->zWiki, "forumEdit"); |
| 871 | if( P("preview") ){ |
| 872 |