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 -N -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 @@ @@ -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 {