ad_text_cite_to_blockquote (private)
ad_text_cite_to_blockquote text
Defined in packages/acs-tcl/tcl/text-html-procs.tcl
Convert freestanding paragraphs with lines starting with a ">" into blockquotes.
- Parameters:
- text (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: if {[string range $text 0 0 ] eq " "} { set result " " set text [string range $text 1 end] } else { set result "" } # # Via "doBlockquotes" we could start blockquote substitution only # when a new paragraph starts; deactivated for now, can start # everywhere. # set doBlockquotes 1 set inBlockquotes 0 foreach line [split $text \n] { #ns_log notice "$inBlockquotes <[expr {[string range $line 0 0] eq ">"}]>: '$line'" if {$inBlockquotes} { if {[string range $line 0 0] eq ">"} { append blockquoted [string range $line 1 end] \n } else { append result "<blockquote>$blockquoted</blockquote>\n" set blockquoted "" set inBlockquotes 0 #set doBlockquotes 1 append result $line \n } } elseif {[string is space $line]} { #set doBlockquotes 1 append result $line \n } elseif {$doBlockquotes && [string range $line 0 0] eq ">"} { set blockquoted [string range $line 1 end]\n set inBlockquotes 1 } else { #set doBlockquotes 0 append result $line \n } } if {$inBlockquotes} { append result "<blockquote>$blockquoted</blockquote>\n" } return $resultXQL Not present: Generic, PostgreSQL, Oracle