#10224 closed Bug (fixed)
ACF should not clean up non-empty link without href attribute
Reported by: | Piotrek Koszuliński | Owned by: | Piotrek Koszuliński |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 4.1 |
Component: | General | Version: | 4.1 |
Keywords: | Cc: | info@… |
Description
Source: http://ckeditor.com/comment/124493#comment-124493
I think that I got a little bit too far when implementing #10073. Non-empty link without href attribute is valid (in HTML5) and should not be stripped when allowed by ACF. Links (not including anchors - <a> elements with name and without href) should only be stripped when they are empty.
Attachments (1)
Change History (10)
comment:1 Changed 11 years ago by
Status: | new → confirmed |
---|
comment:2 Changed 11 years ago by
Owner: | set to Piotrek Koszuliński |
---|---|
Status: | confirmed → assigned |
comment:3 Changed 11 years ago by
Status: | assigned → review |
---|
comment:4 Changed 11 years ago by
Status: | review → review_passed |
---|
Review passed. But non-trivial things like this in tests need additional explanation:
filter( '<p>X<a href="x" name=""></a>X</p>', '<p>XX</p>' ); vs. filter( '<p>X<a name="">A</a>X</p>', '<p>X<a name="">A</a>X</p>' );
Otherwise we'll get lost soon.
comment:5 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | review_passed → closed |
Fixed on major with git:0948a5b on dev and b54618f on tests.
I pushed special comments explaining not obvious cases.
comment:6 Changed 11 years ago by
Cc: | info@… added |
---|
Hi,
Just installed 4.1 and still the same problem :-(
I have (exerpt):
var allowed = 'a(iLink)[!title,!onclick,href]', required = 'a(iLink)[title,onclick]';
editor.addCommand( 'internelink', new CKEDITOR.dialogCommand( 'internelinkDialog' ),{allowedContent: allowed, requiredContent: required } );
It produces the following tag: <p><a class="iLink" onclick="iLink(25)" title="test">test</a></p>
But when changing to source and back all left is: <p>test</p>
I could be wrong in programming the plugin, but I use the link-example as reference!
comment:7 Changed 11 years ago by
I made a sample 10224.html that proves that ACF, if configured correctly, does not remove this link.
I think that the problem is somewhere else. You add a command, but you do not activate the feature. A feature is activated automatically only when it is a button added to toolbar (I don't see a button in that excerpt). In other cases you need to call editor.addFeature()
manually. In your case it will be:
var cmd = editor.addCommand( 'interlink', ... ); editor.addFeature( cmd );
Check the "A button, command or maybe a plugin – which of them is a feature?" chapter in this guide: http://docs.ckeditor.com/#!/guide/plugin_sdk_integration_with_acf
Changed 11 years ago by
Attachment: | 10224.html added |
---|
comment:8 Changed 11 years ago by
Hi Reinmar,
You made my day! Briljant.. it works!!!! Keep this ticket closed and you have earned a beer!
comment:9 Changed 11 years ago by
Hehe :) I'm glad I could help. And that this isn't an editor bug ;).
Pushed t/10224 on dev and tests.
data-cke-saved-*
attributes, because after stripping href, data-cke-saved-href was left, so href was recreated after getting data.