You are here: Foswiki>Tasks Web>Item8888 (11 Apr 2010, TimotheLitt)Edit Attach

Item8888: LinkOptionsPlugin generates style=""

pencil
Priority: Normal
Current State: New
Released In:
Target Release: n/a
Applies To: Extension
Component: LinkOptionsPlugin
Branches:
Reported By: TimotheLitt
Waiting For:
Last Change By: TimotheLitt
The LinkOptionsPlugin generates style="" (e.g null style values) when no CSS is included in the option. This is ugly - actually, I'm not sure it's legal HTML.

Anyway, here is a patch (it's against TWiki, but the code in the foswiki SVN is identical).

--- /var/www/servers/twiki/lib/TWiki/Plugins/LinkOptionsPlugin.pm~      2008-12-12 05:26:15.000000000 -0500
+++ /var/www/servers/twiki/lib/TWiki/Plugins/LinkOptionsPlugin.pm       2010-04-11 14:02:06.000000000 -0400
@@ -213,8 +213,11 @@
     }
   }

-
-  $html =~ s/<a (.+)/<a $extraAtt style="$style" $1/;
+if( length $style ) {
+    $html =~ s/<a (.+)/<a $extraAtt style="$style" $1/;
+} else {
+    $html =~ s/<a (.+)/<a $extraAtt $1/;
+}
   return $html;
 }
-- TimotheLitt - 11 Apr 2010

 
Topic revision: r1 - 11 Apr 2010, TimotheLitt
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy