使 HTMLPurifier 省略双引号 =“attributes”
这并不是非常重要,但我想知道是否可以让 HTMLPurifier 省略参数周围的双引号。当它过滤 HTML 时,通常会将其重新格式化为 XHTML 语法。
但只要可能,我更喜欢输出中的
而不是 class="xyz"
。配置设置 http://htmlpurifier.org/live/configdoc/plain.html 提供没有明显的选项,而且我也懒得去查看代码(500K 确实会吓跑你)。 HTMLPurifier 在某些时候确实使用了 DOMDocument。我不确定这是否只是用于预解析,或者是否用于输出序列化(那么我可以自己回答这个问题:否)。
我浏览了 htmlpurifier 标签,没有发现任何内容。启用实验性(?) HTMLPurifier/Lexer/PH5P.php
解析器不会改变输出行为。
那么是否有一个不常见的设置或调整呢?
This is not terribly important, but I want to find out if you can possibly have HTMLPurifier omit the double quotes around arguments. When it filters HTML it usually reformats it into XHTML syntax.
But I would prefer <div class=alphanum>
rather than class="xyz"
in the output - whenever possible.
The config settings http://htmlpurifier.org/live/configdoc/plain.html provide no obvious option, and I didn't bother to look through the code (500K do scare you away). HTMLPurifier does use DOMDocument at some point. I'm not sure if this is just for pre-parsing, or if it's for output serialization (then I could answer the question myself with: No).
I've glanced through the htmlpurifier tag, found nothing. And enabling the experimental(?) HTMLPurifier/Lexer/PH5P.php
parser doesn't change the output behaviour.
So is there an uncommon setting or tweak for that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
出于安全原因,HTML Purifier 特别引用了其所有属性。没有旋钮可以将其关闭。
HTML Purifier specifically quotes all of its attributes for security reasons. There is no knob to turn it off.