Index: openacs-4/packages/acs-tcl/acs-tcl.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/acs-tcl.info,v diff -u -r1.75 -r1.76 --- openacs-4/packages/acs-tcl/acs-tcl.info 22 Jan 2018 00:17:04 -0000 1.75 +++ openacs-4/packages/acs-tcl/acs-tcl.info 29 Jan 2018 11:03:25 -0000 1.76 @@ -9,7 +9,7 @@ f t - + OpenACS The Kernel Tcl API library. 2017-08-06 @@ -18,7 +18,7 @@ GPL version 2 3 - + Index: openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl,v diff -u -r1.74 -r1.75 --- openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl 19 Jan 2018 20:56:00 -0000 1.74 +++ openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl 29 Jan 2018 11:03:25 -0000 1.75 @@ -1919,7 +1919,7 @@ } { Returns true of ad_html_text_convert can handle the given from and to mime types. } { - set valid_froms { text/enhanced text/plain text/fixed-width text/html text/xml } + set valid_froms { text/enhanced text/markdown text/plain text/fixed-width text/html text/xml } set valid_tos { text/plain text/html } # Validate procedure input set from [ad_decode $from html text/html text text/plain plain text/plain pre text/plain $from] @@ -1969,6 +1969,7 @@
  • text/plain
  • text/enhanced
  • +
  • text/markdown
  • text/fixed-width
  • text/html
@@ -2020,6 +2021,19 @@ } } } + text/markdown { + package require Markdown + switch -- $to { + text/html { + set c [regsub -all \r\n $text \n text] + set text [Markdown::convert $text] + } + text/plain { + set htmlText [Markdown::convert $text] + set text [ad_html_to_text -maxlen $maxlen -- $htmlText] + } + } + } text/plain { switch -- $to { text/html { Index: openacs-4/packages/acs-templating/acs-templating.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/acs-templating.info,v diff -u -r1.61 -r1.62 --- openacs-4/packages/acs-templating/acs-templating.info 22 Jan 2018 00:20:08 -0000 1.61 +++ openacs-4/packages/acs-templating/acs-templating.info 29 Jan 2018 11:03:25 -0000 1.62 @@ -9,7 +9,7 @@ f t - + OpenACS Templating library. 2017-08-06 @@ -27,9 +27,9 @@ GPL version 2 3 - + - + Index: openacs-4/packages/acs-templating/catalog/acs-templating.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/catalog/acs-templating.en_US.ISO-8859-1.xml,v diff -u -r1.23 -r1.24 --- openacs-4/packages/acs-templating/catalog/acs-templating.en_US.ISO-8859-1.xml 24 Nov 2008 14:03:51 -0000 1.23 +++ openacs-4/packages/acs-templating/catalog/acs-templating.en_US.ISO-8859-1.xml 29 Jan 2018 11:03:25 -0000 1.24 @@ -20,12 +20,11 @@ %label% is required %label% is %excess_no_bytes% characters too long. %label% is one character too long. - Enhanced Text - + Markdown Text + Enhanced Text Enter your search text here Fixed-width Text - Format - + Format Formats hours Hours must be between 0 and 23 Index: openacs-4/packages/acs-templating/tcl/richtext-or-file-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/richtext-or-file-procs.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/acs-templating/tcl/richtext-or-file-procs.tcl 1 Oct 2017 12:16:05 -0000 1.9 +++ openacs-4/packages/acs-templating/tcl/richtext-or-file-procs.tcl 29 Jan 2018 11:03:25 -0000 1.10 @@ -44,14 +44,15 @@ ad_proc -public template::util::richtext_or_file::formats {} { Returns a list of valid richtext_or_file formats } { - return { text/enhanced text/plain text/html text/fixed-width } + return { text/enhanced text/markdown text/plain text/html text/fixed-width } } ad_proc -public template::util::richtext_or_file::format_options {} { Returns a formatting option list } { - return { + return { {"Enhanced Text" text/enhanced} + {"Markdown Text" text/markdown} {"Plain Text" text/plain} {"Fixed-width Text" text/fixed-width} {"HTML" text/html} @@ -87,7 +88,7 @@ } # enhanced text and HTML needs to be security checked - if { [lsearch { text/enhanced text/html } $mime_type] == -1 } { + if { $mime_type in { text/enhanced text/html } } { set check_result [ad_html_security_check $text] if { $check_result ne "" } { set message $check_result Index: openacs-4/packages/acs-templating/tcl/richtext-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/richtext-procs.tcl,v diff -u -r1.57 -r1.58 --- openacs-4/packages/acs-templating/tcl/richtext-procs.tcl 22 Jan 2018 09:42:31 -0000 1.57 +++ openacs-4/packages/acs-templating/tcl/richtext-procs.tcl 29 Jan 2018 11:03:25 -0000 1.58 @@ -47,14 +47,15 @@ ad_proc -public template::util::richtext::formats {} { Returns a list of valid richtext formats } { - return { text/enhanced text/plain text/html text/fixed-width } + return { text/enhanced text/markdown text/plain text/html text/fixed-width } } ad_proc -public template::util::richtext::format_options {} { Returns a formatting option list } { return [list \ [list [_ acs-templating.Enhanced_Text] text/enhanced] \ + [list [_ acs-templating.Markdown_Text] text/markdown] \ [list [_ acs-templating.Plain_Text] text/plain] \ [list [_ acs-templating.Fixed_width_Text] text/fixed-width] \ [list [_ acs-templating.HTML] text/html]]