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 -N -r1.18 -r1.19 --- openacs-4/packages/acs-tcl/tcl/test/html-conversion-procs.tcl 25 Jul 2018 13:42:48 -0000 1.18 +++ openacs-4/packages/acs-tcl/tcl/test/html-conversion-procs.tcl 23 Oct 2018 18:38:36 -0000 1.19 @@ -11,17 +11,59 @@ -procs {ad_html_to_text} \ ad_html_to_text_bold { - Test if it converts b tags correctly. + Test if it converts "b" tags correctly. } { set html "Some bold test" set result [ad_html_to_text -- $html] aa_true "contains asterisks?" [regexp {\*bold\*} $result] } +aa_register_case \ + -cats {api smoke} \ + -procs {ad_html_to_text} \ + ad_html_to_text_anchor { + Test if it converts "a" tags correctly. + +} { + set html { + This is a text with an anchor + and a reference + and an empty href + and a regular link. + } + set result [ad_html_to_text -- $html] + aa_log "
$result
" + aa_true "contains link \[1\]" [string match {*\[1\]*} $result] + aa_false "contains link \[2\]" [string match {*\[2\]*} $result] + aa_true "contains link title" [string match {*OpenACS main site*} $result] +} + aa_register_case \ -cats {api smoke} \ + -procs {ad_html_to_text} \ + ad_html_to_text_image { + + Test if it converts "img" tags correctly. + +} { + set html { + This is a text with an regular image , + image with alt text flower, + and an embedded image embedded. + } + set result [ad_html_to_text -- $html] + aa_log "
$result
" + aa_true "contains image" [string match {*\[IMAGE: /images*} $result] + aa_true "contains alt text" [string match {*\[IMAGE: 'flower'*} $result] + aa_true "contains embedded image abbreviated" [string match {*\[IMAGE:*data:...*} $result] +} + + +aa_register_case \ + -cats {api smoke} \ -bugs 386 \ -error_level warning \ -procs {ad_html_to_text} \