PHP Tidy 删除标签
我正在使用以下 HTML 标签,当我通过 tidy 传递它并查看 HTML 输出时,这些标签已被删除。我查看了配置选项列表,但找不到可以防止这种情况发生的选项。
Tidy 删除了:unsubscribe
和 webversion
。
我怎样才能让它保留这样的 HTML 标签?
I am making use of the following HTML tags and when I pass it through tidy and view the HTML output those tags have been removed. I have had a look at the list of config options but I can't find one that prevents this from happening.
Tidy removes: unsubscribe
and webversion
.
How can I get it to keep HTML tags like these?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
PHP Tidy 旨在纠正 HTML,但这些标签无效。通过正确配置 php tidy,您也许可以添加它们。
如果我猜对了,这些应该是 块级元素 阅读如何添加在这里或查看所有其他选项。
PHP Tidy is aimed at correcting HTML and those tags aren't valid. Through correct configuration of php tidy you might be able to add them.
If I guessd correctly those should be blocklevel elements read how to add them here or see all of the other options.
这些不是有效的 HTML 标签,因此 Tidy 将删除它们。您可能需要在“隐藏”标签之前/之后修改文本,可能的话,将它们更改为 [取消订阅] 和 [webversion],然后再更改回
<>
版本。另一种选择是将文件作为 XML 进行处理,这允许任意类型的标签。然而,您必须首先生成有效的 XHTML,否则 tidy 可能会破坏文档的其他部分。Those aren't valid HTML tags, so Tidy will remove them. You might have to massage the text before/after to 'hide' the tags, by changing them to [unsubscribe] and [webversion], possibly, then change back to the
<>
versions afterwards. Another option would be to process the file as XML, which allows arbitrary tags of that sort. However, you'd have to be producing valid XHTML to begin with, or tidy could nuke other parts of your document.