Hi,

I installed the wysiwyg filter b/c I want users to have more flexibility in formatting their text.

However, users are unable to insert line breaks with <enter> or <shift><enter> and all font selections don't work.

I have enabled: Limit allowed HTML tags; WYSIWYG Filter; Convert line breaks into HTML (i.e. <br> and <p>) and Correct faulty and chopped off HTML.

These are my allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <span> <style> <font> <span style> <img>

My WYSIWYG filter HTML elements and attributes:

a[!href|target<_blank|title],
div[align<center?justify?left?right],
p[align<center?justify?left?right],
br,span,em,strong,cite,code,blockquote,ul,ol,li,dl,dt,dd,img,span[*],span[style],font,img[width|height|alt|title|src]

HTML Comments are enabled.

Policy: Whitelist - Add rel="nofollow" to all links except those leading to domain names specified in the list below.

Do I have the above settings right?

What am I missing?

Thanks,

CC

Comments

TwoD’s picture

  1. Disable "Limit allowed HTML tags". You don't need it since you are using WYSIWYG Filter. "Limit allowed HTML tags" will still be removing all style attributes for all tags and removing any tag not present in its whitelist, even if they are allowed by WYSIWYG Filter. WYSIWYG Filter is meant as a replacement, not a compliment, to "Limit allowed HTML tags".
  2. Disable "Convert line breaks into HTML". This will turn any source-code formatting done by the editor into additional linebreaks and paragraphs, making your content break at odd places. Using this filter is convenient when manually typing in content, but complicates things when using an editor that already inserts br and p tags for you. If you still want it enabled, I'd recommend adding and enabling the Wysiwyg Linebreaks plugin as it can transparently convert between using br/p tags and newlines when the editor is enabled/disabled.
  3. I would suggest adding the style attribute to at least your a, p, div and img tags. Floats/text-aligns are often done using styling, not to mention font-weights and colors, and you won't see any of that left in the rendered output with the current WYSIWYG Filter settings. Remember to check which individual style-properties are allowed as well (further down in the settings). Just enabling the style attribute won't help much if the filter cleans it out completely.
CharlieCastle’s picture

Hi TwoD,

Followed your instructions above (#1 & 2) and it now seems to be working!

I tried adding "...adding the style attribute" per #3 but probably did it wrong b/c it says: "The following elements cannot be allowed: style."

Here's the HTML Elements and attributes block:

a[!href|target<_blank|title],
div[align<center?justify?left?right],
p[align<center?justify?left?right],
br,span,em,strong,cite,code,blockquote,ul,ol,li,dl,dt,dd,img,span[*],span[style],font,img[width|height|alt|title|src],style

I also tried "style[*]" and got the same message.

But I'm not sure I need style since it now seems to be working.

Also, please see this issue: http://drupal.org/node/1782654 as my new WYSIWYG text format only works for comments and not content.

Thanks,

CC

TwoD’s picture

Style isn't an element/tag, but an attribute, so you add it in with the list of attribute inside the [] blocks after each element name. You could also put @[style] at the beginning of the HTML Elements and attributes block, to whitelist the style attribute for all elements.

I'm not sure what could cause the text formats to only work for comments, unless perhaps you've got another module which restricts that.

CharlieCastle’s picture

Status: Active » Closed (fixed)

Thanks again for your support. It's greatly appreciated.

I'll mark this as closed and post the question about not getting WYSIWYG text format in the general forum. Maybe it'll get a hit there.

PP

CharlieCastle’s picture

I posted the question here: http://drupal.org/node/1784830

Let's hope I get an answer.

PP