Html id attributes are removed from div even if they are present in the cleanup element

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Html id attributes are removed from div even if they are present in the cleanup element

leconcombre
Hi,

after reading the documentation, I was able to add specific classes to div elements in Xinha rich text boxes. However, I didn't succeed in keeping the div id attributes. I checked and there is an hippohtmlcleaner:attributes id for the hippohtmlcleaner:name div. In fact, it seems like any attributes added in there for divs is not taken into consideration.

I tried adding an id attribute to h1 and it works perfectly.

Is there something special that I need to do for divs?

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Html id attributes are removed from div even if they are present in the cleanup element

Frank van Lankvelt
adding an id attribute to a div works for me, in the Hippo Go Green.
The htmlcleaner configuration there has a cleanupElement with name
'div' and attributes 'class' and 'id'.

Could you verify that the id attribute is not stripped off in the
browser, e.g. by a xinha plugin?  The content should be POSTed in an
ajax request.  Whether the id is there in the POST body then there is
a server-side problem, otherwise it might be the xinha plugin
configuration.

cheers, Frank

On Thu, Dec 13, 2012 at 4:18 PM, leconcombre <[hidden email]> wrote:

> Hi,
>
> after reading the documentation, I was able to add specific classes to div
> elements in Xinha rich text boxes. However, I didn't succeed in keeping the
> div id attributes. I checked and there is an hippohtmlcleaner:attributes id
> for the hippohtmlcleaner:name div. In fact, it seems like any attributes
> added in there for divs is not taken into consideration.
>
> I tried adding an id attribute to h1 and it works perfectly.
>
> Is there something special that I need to do for divs?
>
> Thanks!
>
>
>
> --
> View this message in context: http://hippo.2275632.n2.nabble.com/Html-id-attributes-are-removed-from-div-even-if-they-are-present-in-the-cleanup-element-tp7580010.html
> Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/forums.html



--
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
Boston - 1 Broadway, Cambridge, MA 02142

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
www.onehippo.com
_______________________________________________
Hippo-cms7-user mailing list and forums
http://www.onehippo.org/cms7/support/forums.html
Reply | Threaded
Open this post in threaded view
|

Re: Html id attributes are removed from div even if they are present in the cleanup element

leconcombre
Hello,

finally, I had time to get back to this one! I debugged the some classes and found that the problem (if it is one) is in HtmlRepairer.java.

https://gist.github.com/4597820

I don't know if this is still the case in 7.8, but in 7.7 which I am stuck with :), div only keep the class attribute  regardless of the config on it's cleanupElement.

So I guess I'll switch the div for a p!

Thanks for the help.