I am using the latest WYSIWYG, updated to dev, and the latest CKEditor. When I paste from Word, if the content has an anchor tag, it is removed. For example:
<a name="text">Some sentence here.</a> This is a paragraph describing....
The first sentence wrapped in the anchor is removed. It is not removed if the anchor is an ID instead of a name.
But an anchor with a name and no href is perfectly valid HTML. I paste my same text on the CKEditor demo page (http://ckeditor.com/demo) and the anchor tag remains in the code.
I disabled "Correct faulty HTML", and ACF is also disabled. The anchor plugin button IS enabled.
I do not understand how to get anchor tags to remain in Drupal when they remain perfectly fine in CKEditor itself.
Comment | File | Size | Author |
---|---|---|---|
#3 | Screen Shot 2014-08-26 at 12.27.32 PM.png | 51.46 KB | jennypanighetti |
#2 | Screen Shot 2014-08-25 at 10.15.50 AM.png | 22.77 KB | jennypanighetti |
CKeditor_wysiwyg_anchortags.png | 117.55 KB | jennypanighetti |
Comments
Comment #1
jennypanighetti CreditAttribution: jennypanighetti commentedComment #2
jennypanighetti CreditAttribution: jennypanighetti commentedCorrection: the anchor tags remain in the code, but they are not visible in WYSIWYG like they are on the CKEditor demo page.
They are also NOT visible when viewing the page itself.
Comment #3
jennypanighetti CreditAttribution: jennypanighetti commentedComment #4
TwoDThe "Limit allowed HTML tags" filter is most likely doing this. You'll need to add the a tag to the list of tags not to filter out. I don't remember if it'll still remove a tags unless they have a href attribute though, but that should be easy to spot.
Since that filter also always removes style attributes, preventing any advanced formatting - they're a security risk since style values can contain URLs - I would recommend to instead use the WYSIWYG Filter module. It takes a bit longer to set up but allows for much more detailed control over the allowed output.
Comment #6
jennypanighetti CreditAttribution: jennypanighetti commentedNo, it's not - "Limit allowed HTML tags" is NOT checked for my input format that is experiencing this problem.
Comment #7
jennypanighetti CreditAttribution: jennypanighetti commentedComment #8
TwoDIf the anchor tags remain in the markup after you've disabled the editor, there's nothing wrong with the editor itself or Wysiwyg.
I don't know which stylesheets get applied to that content, but maybe that's what's turning them invisible?
If you're using the editor default styles, it should be visible with a little flag next to it, but I can't tell what'll happen if it's set to use the Drupal theme.