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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jennypanighetti’s picture

Issue summary: View changes
jennypanighetti’s picture

Correction: 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.

jennypanighetti’s picture

TwoD’s picture

Category: Bug report » Support request
Status: Active » Fixed
Issue tags: -ckeditor, -anchor, -removed

The "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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

jennypanighetti’s picture

No, it's not - "Limit allowed HTML tags" is NOT checked for my input format that is experiencing this problem.

jennypanighetti’s picture

Status: Closed (fixed) » Active
TwoD’s picture

If 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.