cross is now running Foswiki 2.1.3 Beta 1. Please open a task for any issues.
You are here: Foswiki>Tasks Web>Item212 (08 Jan 2009, KwangErnLiew)Edit Attach

Item212: stop url(http://... something.png) from being made into a html link, so inline images in css style isn't terminal

Priority: Normal
Current State: Closed
Released In: 1.0.0
Target Release: patch
Applies To: Engine
Reported By: SvenDowideit
Waiting For:
Last Change By: KwangErnLiew
Item210 showed up a problem with inline css when PubUrlPath is set to an absolute URL (which happens to be legal as per code), or if the 'use absolute url's is chosen.

its clearly bug in several places - rendering should be more careful about what it turns into an a href, and Plugins (evidently) cannot assume that PUBURLPATH will actually be a path.

so, for the core, I'm going to apply

Index: lib/TWiki/
--- lib/TWiki/ (revision 767)
+++ lib/TWiki/ (working copy)
@@ -1151,9 +1151,9 @@
     $text =~ s/{$TWiki::TranslationToken/</go;
     $text =~ s/}$TWiki::TranslationToken/>/go;
-    # standard URI
+    # standard URI (don't modify if url(http://as) form
     $text =~
-s/(^|[-*\s(|])($TWiki::regex{linkProtocolPattern}:([^\s<>"]+[^\s*.,!?;:)<|]))/$1._externalLink( $this,$2)/geo;
+s/(^|(?<!url)[-*\s(|])($TWiki::regex{linkProtocolPattern}:([^\s<>"]+[^\s*.,!?;:)<|]))/$1._externalLink( $this,$2)/geo;
     # other entities
     $text =~ s/&(\w+);/$TWiki::TranslationToken$1;/g;              # "&abc;"

which will not make any url() into an a href

Looks like SmiliesPlugin also makes this assumption - fixing

crud - lots of code makes this non-right assumption.

ok, so TWiki::Func::getPubUrl() should actually call TWiki::getPubUrl, and pass parameters like $absolute - just returning the TWiki::cfg is way to naive.


Just had the same issue a few days ago. Helped myself with the <literal> tag.

-- Oliver

closing, the real change is in a feature request to deprecate context information in building URL's

-- SvenDowideit - 12 Dec 2008

ItemTemplate edit

Summary stop url(http://... something.png) from being made into a html link, so inline images in css style isn't terminal
ReportedBy SvenDowideit
SVN Range TWiki-4.2.3, Wed, 06 Aug 2008, build 17396
AppliesTo Engine
Priority Normal
CurrentState Closed
Checkins distro:40c5661ffa30 Rev 769 not found DistributedServersPlugin:d544c3e37d83 distro:bf1ea785d01a Rev 771 not found
TargetRelease patch
ReleasedIn 1.0.0
Topic revision: r12 - 08 Jan 2009, KwangErnLiew - This page was cached on 22 Jan 2017 - 00:42.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License