开发者

How to strip out 
 character references inserted by Diazo into text nodes

开发者 https://www.devze.com 2023-03-11 01:59 出处:网络
I\'m using plone.app.theming 1.0b5 and Plone 4.1 rc3.Our Diazo rules contain an number of external content includes and we\'re using one such include to insert Google Analytics script into the result:

I'm using plone.app.theming 1.0b5 and Plone 4.1 rc3. Our Diazo rules contain an number of external content includes and we're using one such include to insert Google Analytics script into the result:

    <append theme="/html/head" content="/html/head/script" 
            href="@@standard-page-elements" />

Unfortunately the script tag from the view is being mangled during the transform such that any carriage returns are converted to character references (&#13;)

This is due to 开发者_开发问答the way lxml serializes and deserializes (see this Plone bug report).

I'd like a work around in the meantime but can't figure out a Diazo rule that would strip these references out.


As noted above:

The bug has been fixed in the trunk of Diazo (thanks Laurence) so I no longer need to do this. I didn't manage to figure it out: it doesn't seem to me you can alter external content through Diazo, only the main content.

0

精彩评论

暂无评论...
验证码 换一张
取 消