_acs-tcl__ad_html_text_convert (private)
_acs-tcl__ad_html_text_convert
Defined in packages/acs-tcl/tcl/test/html-conversion-procs.tcl
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: set _aa_export {} set body_count 1 foreach testcase_body {{ #---------------------------------------------------------------------- # from text/enhanced #---------------------------------------------------------------------- set string "What?\n<i>Never mind, buddy</i>" aa_equals "" [ad_html_text_convert -from "text/enhanced" -to "text/html" -truncate_len 14 -- $string] [ad_enhanced_text_to_html "What?\n<i>Never</i>..."] # The string is longer in plaintext, because the "_" symbol to # denote italics is counted as well. aa_equals "" [ad_html_text_convert -from "text/enhanced" -to "text/plain" -truncate_len 15 -- $string] "What?\n_Never..." #---------------------------------------------------------------------- # from text/markdown #---------------------------------------------------------------------- if {![catch {package present Markdown}]} { set string "What?\n*Never mind, buddy*" aa_equals "" [ad_html_text_convert -from "text/markdown" -to "text/html" -truncate_len 14 -- $string] "What?\n<i>Never</i>..." aa_equals "" [ad_html_text_convert -from "text/markdown" -to "text/plain" -truncate_len 15 -- $string] "What?\n_Never..." } #---------------------------------------------------------------------- # from text/plain #---------------------------------------------------------------------- set string "What?\nNever mind, buddy" aa_equals "" [ad_html_text_convert -from "text/plain" -to "text/html" -truncate_len 14 -- $string] "What?<br>\nNever..." aa_equals "" [ad_html_text_convert -from "text/plain" -to "text/plain" -truncate_len 14 -- $string] "What?\nNever..." #---------------------------------------------------------------------- # from text/fixed-width #---------------------------------------------------------------------- set string "What?\nNever mind, buddy" aa_equals "" [ad_html_text_convert -from "text/fixed-width" -to "text/html" -truncate_len 14 -- $string] "<pre>What?\nNever</pre>..." aa_equals "" [ad_html_text_convert -from "text/fixed-width" -to "text/plain" -truncate_len 14 -- $string] "What?\nNever..." #---------------------------------------------------------------------- # from text/html #---------------------------------------------------------------------- set string "What?<br><i>Never mind, buddy</i>" aa_equals "" [ad_html_text_convert -from "text/html" -to "text/html" -truncate_len 14 -- $string] "What?<br><i>Never</i>..." aa_equals "" [ad_html_text_convert -from "text/html" -to "text/plain" -truncate_len 15 -- $string] "What?\n_Never..." set long_string [string repeat "Very long text. " 10] aa_equals "No truncation" [ad_html_text_convert -from "text/html" -to "text/html" -truncate_len [string length $long_string] -- $long_string] $long_string }} { aa_log "Running testcase body $body_count" set ::__aa_test_indent [info level] set catch_val [catch $testcase_body msg] if {$catch_val != 0 && $catch_val != 2} { aa_log_result "fail" "ad_html_text_convert (body $body_count): Error during execution: $msg, stack trace: \n$::errorInfo" } incr body_count }XQL Not present: Generic, PostgreSQL, Oracle