fix poplink with new sub routine
authorAdrian Oldham <adriann@visualthought.com.au>
Mon, 21 Oct 2013 04:12:45 +0000 (15:12 +1100)
committerTony Cook <tony@develop-help.com>
Sun, 3 Nov 2013 23:20:21 +0000 (10:20 +1100)
site/cgi-bin/modules/DevHelp/Formatter.pm

index fac3b11d4f74e09a3e9b8b548bc299908851bf2b..86f0c08e96bf7d94916e207c0287f01f89f4dcd7 100644 (file)
@@ -171,6 +171,12 @@ sub link {
   qq/<a href="/ . $self->rewrite_url($url, $text, "link") . qq(">$text</a>)
 }
 
+sub poplink {
+  my ($self, $url, $text) = @_;
+
+  qq/<a href="/ . $self->rewrite_url($url, $text, "poplink") . qq(" target="_blank">$text</a>)
+}
+
 sub replace_char {
   my ($self, $rpart) = @_;
   $$rpart =~ s#(acronym|abbr|dfn|cite)\[(?:\r?\n)?([^|\]\[]+)\|([^\]\[]+)\|([^\]\[]+?)(?:\r?\n)?\]#
@@ -198,10 +204,10 @@ sub replace_char {
     $self->_fix_spanned("<$1>", "</$1>", $2)#egi
     and return 1;
   $$rpart =~ s#poplink\[([^|\]\[]+)\|([^\]\[]+)\]#
-    $self->(qq/<a href="/ . $self->rewrite_url($1, $2, "poplink") . qq/" target="_blank">/, "</a>", $2, 'poplink')#eig
+    $self->poplink($1, $2)#eig
     and return 1;
   $$rpart =~ s#poplink\[([^|\]\[]+)\]#
-    $self->(qq/<a href="/ . $self->rewrite_url($1, $1, "poplink") . qq/" target="_blank">/, "</a>", $1, 'poplink')#ieg
+    $self->poplink($1, $2)#eig
     and return 1;
   $$rpart =~ s#link\[([^|\]\[]+)\|([^\]\[]+)\]#
     $self->link($1, $2)#eig