Index: openacs-4/packages/acs-tcl/tcl/test/html-conversion-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/html-conversion-procs.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/acs-tcl/tcl/test/html-conversion-procs.tcl 30 Sep 2017 18:12:52 -0000 1.12 +++ openacs-4/packages/acs-tcl/tcl/test/html-conversion-procs.tcl 15 Mar 2018 12:33:05 -0000 1.13 @@ -298,6 +298,87 @@ } +aa_register_case -cats {api smoke} -procs {ad_html_text_convert} ad_text_html_convert_to_plain { + Test rendering of a more or less standard HTML text +} { + + set html {
This is bold and this is strong. + This is italics and this is em. + A text with a link. +
+Now the same with a blockquote: +
+ This is bold and this is strong. + This is italics and this is em. + A text with a link. ++ Now a text with a ul: +
+ set x 1 + set r [expr {$x + 1}] ++ } + set result [ad_html_text_convert -from text/html -to text/plain $html] + + aa_log "Resulting text:\n$result" + aa_true "Text contains title" [string match {Some Title*} $result] + aa_true "
results in linebreaks and deeper indentation" { + [string first "\n set x" $result] > 0 + && [string first "\n set r" $result] > 0 + } + + + aa_true "Text contains two links" { + [string first {[1].} $result] > 0 + && [string first {[2].} $result] > 0 + } + aa_true "Text contains two references" { + [string first {[1] /foo} $result] > 0 + && [string first {[2] /bar} $result] > 0 + } + aa_true "Blockquote is indented" { + [string first { This is *bold} $result] > 0 + } + + + +} + # Local variables: # mode: tcl # tcl-indent-level: 4