Style tag in the body being stripped

3 messages Options
Embed this post
Permalink
J. Tyler

Style tag in the body being stripped

Reply Threaded More More options
Print post
Permalink
We are in the process of upgrading our current editor and replacing it with EditLive.  One issue we just encountered is that our users have been placing style tags within the body of their html for years.  EditLive realizes that a style tag should not be in the body and happily strips it out.

My users will not be very happy when they see this.  Especially because there is no warning to them.    Quoting HTML standards to them is not an option.

Is there any workaround for this?  An undocumented parameter on the htmlFilter perhaps?  

Here is our htmlFilter and sourceEditor:

<htmlFilter allowUnknownTags="true" commentStyles="true"
encloseText="true" indentContent="true" logicalEmphasis=""true""
outputXHTML="true" outputXML="false" numericEntities="false" quoteMarks="false"
uppercaseAttributes="true" uppercaseTags="true" wrapLength="80"/>

<sourceEditor enabled="true" showBodyOnly="true"/>
J. Tyler

Re: Style tag in the body being stripped - Clarification

Reply Threaded More More options
Print post
Permalink
I should clarify to say that our users will be editing their existing content (content that contains the style tag in the wrong place) with the new editor.  They will save it and the style tag will be lost.

When they create new content, it won't be as much of an issue.
Adrian Sutton

Re: Style tag in the body being stripped

Reply Threaded More More options
Print post
Permalink
In reply to this post by J. Tyler
On 5 Nov 2009, at 13:47, J. Tyler wrote:
> We are in the process of upgrading our current editor and replacing  
> it with
> EditLive.  One issue we just encountered is that our users have been  
> placing
> style tags within the body of their html for years.  EditLive  
> realizes that
> a style tag should not be in the body and happily strips it out.

Actually, it doesn't strip it out, it moves it to the head section of  
the document.  The distinction turns out to be quite useful because  
the style information isn't actually being lost and you can retrieve  
it using the GetStyles call and it would also be included if you  
retrieved the full document instead of just the body content.  I  
believe with the autosubmit architecture the styles are automatically  
submitted in a field called editorName_styles (where editorName is the  
field you'd get the main content from).

If you're happy to not follow standards, you can simply prepend the  
styles information back onto the body.  If you want to do it properly  
you can store them in a separate database field and then output them  
in the document head as appropriate.  The only catch is that if you  
have <sourceEditor showBodyOnly="true" /> the styles won't be shown in  
code view because only the body content is being displayed.  A  
SourceFilter which put the styles back into the body would avoid that  
since they run when switching views.

Regards,

Adrian Sutton.
______________________
Adrian Sutton, CTO
UK: +44 1 628 353 032  US: +1 (650) 292 9659 x717
Ephox http://www.ephox.com/
Ephox Blogs http://planet.ephox.com/, Personal Blog http://www.symphonious.net/



_______________________________________________
[hidden email]
List instructions at http://liveworks.ephox.com/mailing-list/