Foswiki on GitHub is open for business! Next release meeting: Monday October 13, 1300Z

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

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Normal Closed Engine    
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/Render.pm
===================================================================
--- lib/TWiki/Render.pm (revision 767)
+++ lib/TWiki/Render.pm (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.

--Sven

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
Codebase
SVN Range TWiki-4.2.3, Wed, 06 Aug 2008, build 17396
AppliesTo Engine
Component
Priority Normal
CurrentState Closed
WaitingFor
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
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons License