Loading...
 
Skip to main content

External links icon and target _blank is disappearing on subsequent wysiwyg save

Status
Pending
Subject
External links icon and target _blank is disappearing on subsequent wysiwyg save
Version
6.x
Feature
WYSIWYG (What You See is What You Get)
Submitted by
Nelson Ko
Lastmod by
Nelson Ko
Rating
(0)
Description
external links are being "cleaned up" on subsequent changes in the wysiwyg (when I first save I get the external link icon and target _blank but when I reload the article in the editor, the icon is gone, and also target=_blank).
Solution

fix in r30331 with check for pref popupLinks feature or wysiwyg before doing the below fix.

Modifying function in lib/htmlpurifier_tiki/HTMLPurifier.tiki.php according to example in http://htmlpurifier.org/docs/enduser-customize.html seems to do the trick, but not sure if this is the best fix. After all , HTML strict does not allow target attribute. o maybe some js approach is better...

Copy to clipboard
function getHTMLPurifierTikiConfig() { global $tikipath; $d = $tikipath.'temp/cache/HTMLPurifierCache'; if (!is_dir($d)) { if (!mkdir($d)) { $d = $tikipath.'temp/cache'; } } $conf = HTMLPurifier_Config::createDefault(); $conf->set('Cache.SerializerPath', $d); // CUSTOM add exceptions $conf->set('HTML.DefinitionID', 'allow target'); $config->set('HTML.DefinitionRev', 1); $def = $conf->getHTMLDefinition(true); $def->addAttribute('a', 'target', 'Enum#_blank,_self,_target,_top'); return $conf; }
Importance
8
Priority
40
Demonstrate Bug on Tiki 19+
Demonstrate Bug (older Tiki versions)
Ticket ID
3597
Created
Wednesday 20 October, 2010 14:11:19 UTC
by Nelson Ko
LastModif
Wednesday 27 October, 2010 00:33:24 UTC


Show PHP error messages