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.9 -r1.9.2.1
--- openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl 15 Sep 2002 22:10:50 -0000 1.9
+++ openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl 15 Oct 2002 21:09:52 -0000 1.9.2.1
@@ -46,17 +46,23 @@
regsub -nocase -all {([^a-zA-Z0-9]+)(ftp://[^\(\)"<>\s]+)} $text "\\1\tsTaRtUrL\\2eNdUrL\t" text
# email links have the form xxx@xxx.xxx
- regsub -nocase -all {([^a-zA-Z0-9]+)([^\(\)\s:;,@<>]+@[^\(\)\s.:;,@<>]+[.][^\(\)\s:;,@<>]+)} $text \
- "\\1\tsTaRtEmAiL\\2eNdEmAiL\t" text
+ # JCD: don't treat things =xxx@xxx.xxx as email since most
+ # common occurance seems to be in urls (although VPATH bounce
+ # emails like bounce-user=domain.com@sourcehost.com will then not
+ # work correctly). It's all quite ugly.
+
+ regsub -nocase -all {([^a-zA-Z0-9=]+)(mailto:)?([^=\(\)\s:;,@<>]+@[^\(\)\s.:;,@<>]+[.][^\(\)\s:;,@<>]+)} $text \
+ "\\1\tsTaRtEmAiL\\3eNdEmAiL\t" text
+
}
# At this point, before inserting some of our own <, >, and "'s
# we quote the ones entered by the user:
set text [ad_quotehtml $text]
# Convert _single_ CRLF's to
's to preserve line breaks
- regsub -all {\r*\n} $text "
" text
+ regsub -all {\r*\n} $text "
\n" text
# Convert every two spaces to an nbsp
regsub -all { } $text "\\\ " text
@@ -82,6 +88,11 @@
# Convert every tab to 4 nbsp's
regsub -all {\t} $text {\ \ \ \ } text
+ # JCD: Remove all the eNd sTaRt stuff and warn if we do it since its bad
+ # to have these left (means something is broken in our regexps above)
+ if {[regsub -all {(sTaRtUrL|eNdUrL|sTaRtEmAiL|eNdEmAiL)} $text {} text]} {
+ ns_log warning "Replaced sTaRt/eNd magic tags in ad_text_to_html"
+ }
return $text
}