about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-03-04 20:50:34 +0000
committerEric Wong <e@80x24.org>2015-03-04 20:50:34 +0000
commitc2cf793143aaefde5b12d3a6909c5097fda76228 (patch)
treefc9db62ada99cc4fc6a52cbed855bb89285f2ebb
parente90a7953217879258cee069dab6a4b45df5c8d07 (diff)
downloadpublic-inbox-c2cf793143aaefde5b12d3a6909c5097fda76228.tar.gz
We can't add newlines to links, unfortunately, because
quote-folding is line-based and (being regexp-based) needs
to happen after linkification.
-rw-r--r--lib/PublicInbox/View.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 3bb38537..3695bb2a 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -221,7 +221,9 @@ sub add_filename_line {
 my $LINK_RE = qr!\b((?:ftp|https?|nntp)://[@\w\+\&\?\.\%\;/#=-]+)!;
 
 sub linkify {
-        $_[0] =~ s!$LINK_RE!<a\nhref="$1"\n>$1</a>!g;
+        # no newlines added here since it'd break the splitting we do
+        # to fold quotes
+        $_[0] =~ s!$LINK_RE!<a href="$1">$1</a>!g;
 }
 
 sub add_text_body_short {