Opened 14 years ago
Closed 14 years ago
#7287 closed Bug (invalid)
change href in a tag with htmlFilter doenst work
Reported by: | Eric Brüggemann | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Core : Output Data | Version: | 3.5 |
Keywords: | htmlFilter | Cc: |
Description
If you try to apply a filter for the href attribute auf a tags the new value is not written back to the html so.
CKEDITOR.on( 'instanceReady', function( ev ) { var editor = ev.editor, dataProcessor = editor.dataProcessor, htmlFilter = dataProcessor && dataProcessor.htmlFilter; htmlFilter.addRules({ elements :{ a : function ( element ){ alert(element.attributes['href']); element.attributes['href'] = "http://www.ckeditor.com"; alert(element.attributes['href']); } } }); });
this will first alert the old href than the changed href but the href attribute itself wont change
Editor protects certain attributes to avoid browser touching them, so when in html filter, please manipulate "data-cke-saved-href" instead of "href".