告诉 Zope/Chameleon 不要解析某个部分?
我有一个使用 Chameleon 的金字塔应用程序。我需要在 DOCTYPE 中声明一些属性,如下所示:
<!DOCTYPE public html .........
[
<!ATTLIST tag attributes CDATA #IMPLIED>
]>
当我将其添加到模板中时,id 无法正确呈现,并且我的浏览器绘制“]>”。
当我删除 ATTLIST 并仅执行 时,一切正常。
我如何告诉 Chameleon 不要解析 ATTLIST 部分并按原样复制它?
I have a Pyramid app that uses Chameleon. I need to declare some attributes in my DOCTYPE, like so:
<!DOCTYPE public html .........
[
<!ATTLIST tag attributes CDATA #IMPLIED>
]>
When I add this to my template, id doesn't get rendered properly and my browser draws "]>".
When I remove the ATTLIST and only do <!DOCTYPE public html .........>
, everything works.
How can I tell Chameleon to not parse the ATTLIST section and copy it as is?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这和变色龙完全没有关系。如果我将该代码粘贴到文件中并在浏览器中打开它,我也会看到
]>
。编辑:我明白了。将文件重命名为
.xhtml
并且它将起作用(至少对我来说)。如果您通过网络接收它,则将
content-type
设置为application/xhtml+xml
也会以同样的方式工作。That has absolutely nothing to do with Chameleon. If I paste that code into a file and open it in my browser, I see
]>
as well.Edit: I figured it out. Rename the file to
.xhtml
and it will work (at least for me).If you're receiving it over the network, having the
content-type
set toapplication/xhtml+xml
would work the same way.