Closed (fixed)
Project:
htmLawed
Version:
7.x-3.0
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
29 Jun 2011 at 16:16 UTC
Updated:
23 Mar 2013 at 18:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
alpha2zee commentedIs the markup for alignment produced by ckeditor 'style' (tag attribute) based? If so, you will have to edit the value for 'Config.' as the default value denies use of the 'style' attribute. You can remove , style from 'deny_attribute'=>'id, style' in 'Config.'.
Note that this will permit anything (besides text alignment properties) within 'style'. If ckeditor cannot be configured to restrict what is allowed within 'style' and you want only text-alignment property, then consider using the 'Spec.' form-field for htmLawed module settings. E.g., to permit 'style' with only 'text-align' property within only 'p', 'div' and 'td' tags, keep 'deny_attribute'=>'id, style' in 'Config.'. Then, for 'Spec.', put in p=*, style(match="/^\s*text-align\s*:\s*((left)|(right)|(center));*\s*$/"); div=*, style(match="/^\s*text-align\s*:\s*((left)|(right)|(center));*\s*$/"); td=*, style(match="/^\s*text-align\s*:\s*((left)|(right)|(center));*\s*$/");. The 'Config.' value denies 'style' for all tags. Then, the 'Spec.' value causes 'style' to be allowed for 'p', 'div' and 'td' as long as it contains only 'text-align: left;', etc.
For more on 'Spec.', see http://www.bioinformatics.org/phplabware/internal_utilities/htmLawed/htm....
Comment #2
CFW commentedThanks, it works the way I wanted.
I also want user to able to insert images, see below. I read the documentation but don't understand all of it.
<img alt="Alt" src="http://localhost/sites/default/files/styles/thumbnail/public/pictures/picture-1-1309446318.png" style="border-bottom: 2px solid; border-left: 2px solid; margin: 1px 10px; width: 97px; float: left; height: 100px; border-top: 2px solid" />Thanks again,
Comment #3
alpha2zee commentedIn my first reply, the example value suggested for 'Spec.' tells htmLawed to allow style within 'p', 'div' and 'td' as long as 'style' contains only 'text-align...'. To allow 'style' for 'img', you have to add this rule to 'Spec.'. E.g., you can append img=*, style; to the example 'Spec.' value above. With this, 'img' can have 'style' with anything. If you are good at regular expressions, then you can create a pattern so that 'style' for 'img' can contain only certain values.
If you think you get content with a lot of HTML tags with 'style' values with lots of different style-properties, I suggest not using 'Spec.' at all and instead removing 'style' from 'deny_attribute' in 'Config.' (see the beginning of my first reply).
Comment #4
CFW commentedThanks for your help alpha2zee.
Comment #5
Anonymous (not verified) commentedDoes this still work? I'm attaching screenshots of my configuration....seems like everything is correct I only took off the "td" element for Spec. Help...please...
Just for clarification, I want to allow the various text-alignments in "style" for both "p" and "div". Thanks!!!!