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 -r1.109.2.18 -r1.109.2.19 --- openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl 28 Oct 2020 15:39:19 -0000 1.109.2.18 +++ openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl 1 Feb 2021 10:51:09 -0000 1.109.2.19 @@ -186,25 +186,25 @@ if { !$no_quote_p } { # Convert every two spaces to an nbsp - regsub -all { } $text "\\\  " text + regsub -all -- { } $text "\\\  " text # Convert tabs to four nbsp's - regsub -all {\t} $text {\ \ \ \ } text + regsub -all -- {\t} $text {\ \ \ \ } text } if { $nr_links > 0} { # # Move the end of the link before any punctuation marks at the # end of the URL. # - regsub -all {([\]!?.:;,<>\(\)\}\"'-]+)(\u0003)} $text {\2\1} text + regsub -all -- {([\]!?.:;,<>\(\)\}\"'-]+)(\u0003)} $text {\2\1} text # # Convert the marked links and emails into "..." # - regsub -all {\u0002([^\u0003]+?)\u0003} $text {\1} text + regsub -all -- {\u0002([^\u0003]+?)\u0003} $text {\1} text - set changed_back [regsub -all {(\u0002|\u0003)} $text {} text] + set changed_back [regsub -all -- {(\u0002|\u0003)} $text {} text] if {$includes_html_p} { # # All markers should be gone now. @@ -270,7 +270,7 @@ # if {[info exists path]} { set path "[string trim $path /]/" - regsub -all {(href|src)\s*=\s*['\"]([^/][^\u0001:'\"]+?)['\"]} $html \ + regsub -all -- {(href|src)\s*=\s*['\"]([^/][^\u0001:'\"]+?)['\"]} $html \ "\\1='${location}${path}\\2'" html } @@ -300,14 +300,14 @@ regsub {[\s]+$} $text {} text # Make sure all line breaks are single \n's - regsub -all {\r\n} $text "\n" text - regsub -all {\r} $text "\n" text + regsub -all -- {\r\n} $text "\n" text + regsub -all -- {\r} $text "\n" text # Remove whitespace before \n's - regsub -all {[ \t]+\n} $text "\n" text + regsub -all -- {[ \t]+\n} $text "\n" text # Wrap P's around paragraphs - regsub -all {([^\n\s])\n\n+([^\n\s])} $text {\1

\2} text + regsub -all -- {([^\n\s])\n\n+([^\n\s])} $text {\1

\2} text # remove line breaks right before and after HTML tags that will insert a paragraph break themselves if { $includes_html_p } { @@ -316,10 +316,10 @@ } # Convert _single_ CRLF's to
's to preserve line breaks - regsub -all {\n} $text "
\n" text + regsub -all -- {\n} $text "
\n" text # Add line breaks to P tags - #regsub -all {

} $text "

\n" text + #regsub -all -- {

} $text "

\n" text return $text } @@ -529,7 +529,7 @@ # First try to fix up < not part of a tag. - regsub -all {<([^/[:alpha:]!])} $frag {\<\1} frag + regsub -all -- {<([^/[:alpha:]!])} $frag {\<\1} frag # no we do is chop off any trailing unclosed tag # since when we substr blobs this sometimes happens @@ -1434,14 +1434,14 @@ string map [list \n \\n \b \\b \f \\f \r \\r \t \\t \v \\v \" {\"} ' {\'}] $string # Escape quotes and backslashes (non greedy) - #regsub -all {.??([^\\])?('|\"|\\)} $string {\1\\\2} string + #regsub -all -- {.??([^\\])?('|\"|\\)} $string {\1\\\2} string # Escape characters are replaced with their escape sequence - #regsub -all {\b} $string {\\b} string - #regsub -all {\f} $string {\\f} string - #regsub -all {\n} $string {\\n} string - #regsub -all {\r} $string {\\r} string - #regsub -all {\t} $string {\\t} string - #regsub -all {\v} $string {\\v} string + #regsub -all -- {\b} $string {\\b} string + #regsub -all -- {\f} $string {\\f} string + #regsub -all -- {\n} $string {\\n} string + #regsub -all -- {\r} $string {\\r} string + #regsub -all -- {\t} $string {\\t} string + #regsub -all -- {\v} $string {\\v} string #return $string } @@ -1787,7 +1787,7 @@ # If we're not in a PRE if { $output(pre) <= 0 } { # collapse all whitespace - regsub -all {\s+} $text { } text + regsub -all -- {\s+} $text { } text # if there's only spaces in the string, wait until later if {$text eq " "} { @@ -1807,10 +1807,10 @@ } } else { # we're in a PRE: clean line breaks and tabs - regsub -all {\r\n} $text "\n" text - regsub -all {\r} $text "\n" text + regsub -all -- {\r\n} $text "\n" text + regsub -all -- {\r} $text "\n" text # tabs become four spaces - regsub -all {[\v\t]} $text { } text + regsub -all -- {[\v\t]} $text { } text } # output any pending paragraph breaks, line breaks or spaces. @@ -1853,7 +1853,7 @@ # convert  's # We do this now, so that they're displayed, but not treated, whitespace. - regsub -all { } $word { } word + regsub -all -- { } $word { } word set wordlen [string length $word] switch -glob -- $word { @@ -1920,14 +1920,14 @@ consider how they interact with character encodings. } { - regsub -all {<} $html {<} html - regsub -all {>} $html {>} html - regsub -all {"} $html "\"" html - regsub -all {—} $html {--} html - regsub -all {—} $html {--} html + regsub -all -- {<} $html {<} html + regsub -all -- {>} $html {>} html + regsub -all -- {"} $html "\"" html + regsub -all -- {—} $html {--} html + regsub -all -- {—} $html {--} html # Need to do the & last, because otherwise it could interfere with the other expansions, # e.g., if the text said &lt;, that would be translated into <, instead of < - regsub -all {&} $html {\&} html + regsub -all -- {&} $html {\&} html return $html } @@ -2444,7 +2444,7 @@ ad_proc util_remove_html_tags { html } { Removes everything between < and > from the string. } { - regsub -all {<[^>]*>} $html {} html + regsub -all -- {<[^>]*>} $html {} html return $html }