Item11345: Make copying of external resources (images) optional
Priority: Enhancement
Current State: Closed
Released In: n/a
Target Release: n/a
I need to retain external links in the HTML rendering of the Wiki pages. As I read the code, there are currently two places where copying of internal resources is done:
- In
Publisher::_copyResource
, when examining CSS files
- In
Publisher::_handleURL
, which is called once, when dealing with <img>
tags
The first instance is accidental (I believe) and doesn't really help much as the CSS itself would need to be rewritten to take advantage of the local version of the resource.
Item10597 provides a patch which removes this behavior.
The second instance is handled by the attached patch, which provides a new boolean configuration parameter,
copyexternal
, which is used by
_handleURL
. It defaults to
1
(for backwards compatibility).
This patch also contains a fix to
_rsrcpath
to ignore URLish paths. This is actually a bug fix, as
_handleURL
will return the URL if it could not parse or retrieve the contents. This was passed on to
_rsrcpath
which assumed all paths were local directory paths.
I've had to also include the patch from
Item11339 in this patch. Sorry about the mess.
The patch should apply against version 2.3.2 of the plugin.
--
DiabJerius - 09 Dec 2011
Patch applied.
--
CrawfordCurrie - 30 Jul 2012