Permalink
Browse files

Item11862: Item11814: Fix roundtrip of URL macros

Broken by the intital fix to Item11814.  Revert the fix to Item11814 and
remove the url decode.

git-svn-id: http://svn.foswiki.org/trunk@14826 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information...
GeorgeClark GeorgeClark
GeorgeClark authored and GeorgeClark committed May 15, 2012
1 parent 53aee0f commit 3daf071f94a1501006d06ca05673c4ccf223fde8
Showing with 10 additions and 13 deletions.
  1. +10 −13 WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin/HTML2TML/Node.pm
@@ -1410,8 +1410,10 @@ sub _handleA {
( $this->{attrs}->{class}
&& $this->{attrs}->{class} =~ m/\bTMLlink\b/ );
- # decode URL params in the href
- $href =~ s/%([0-9A-F]{2})/chr(hex($1))/gei;
+# SMELL: Item11814 - this corrupts URL's that must be encoded, ex. embedded Newline
+# decode URL params in the href
+#$href =~ s/%([0-9A-F]{2})/chr(hex($1))/gei;
+
if ( $this->{context} && $this->{context}->{rewriteURL} ) {
$href = $this->{context}->{rewriteURL}->( $href, $this->{context} );
}
@@ -1446,22 +1448,17 @@ sub _handleA {
return ( 0, $WC::CHECK1 . $nop . $text . $WC::CHECK2 );
}
if ( $text eq $href ) {
- return ( 0,
- $WC::CHECKw . '[' . $nop . '[' . $this->{attrs}{href} . ']]' );
+ return ( 0, $WC::CHECKw . '[' . $nop . '[' . $href . ']]' );
}
# we must quote square brackets in [[...][...]] notation
- $text =~ s/[[]/[/g;
- $text =~ s/[]]/]/g;
- $this->{attrs}{href} =~ s/[[]/%5B/g;
- $this->{attrs}{href} =~ s/[]]/%5D/g;
+ $text =~ s/[[]/[/g;
+ $text =~ s/[]]/]/g;
+ $href =~ s/[[]/%5B/g;
+ $href =~ s/[]]/%5D/g;
return ( 0,
- $WC::CHECKw . '['
- . $nop . '['
- . $this->{attrs}{href} . ']['
- . $text
- . ']]' );
+ $WC::CHECKw . '[' . $nop . '[' . $href . '][' . $text . ']]' );
}
elsif ( $this->{attrs}->{name} ) {

0 comments on commit 3daf071

Please sign in to comment.