简体   繁体   English

如何停止HTMLpurifier在markdown中转义PHP速记语法示例?

[英]How do I stop HTMLpurifier from escaping PHP shorthand syntax examples in markdown?

I'm using markdown and HTMLpurifier and I want to have examples of shorthand PHP ( <?= $variable ?> ) in the markdown code (using the indent syntax) however HTMLpurifier is not recognizing the tag < as an allowed element and is escaping it. 我正在使用markdown和HTMLpurifier,并且我想在markdown代码中使用简写的PHP( <?= $variable ?> )示例(使用缩进语法),但是HTMLpurifier无法将标记<识别为允许元素,并且正在转义它。

Any idea what config option I need to enable in HTMLpurifier to stop it escaping this? 知道我需要在HTMLpurifier中启用哪个配置选项才能阻止它转义吗?

It's currently unsupported, you might be interested in joining this old thread from HTMLpurifier forums - PHP shorthand tag 当前不受支持,您可能有兴趣加入HTMLpurifier论坛中的旧线程-PHP速记标签

Another solution is to run your own str_replace to restore php sections if that is feasible and doesn't cause any security holes. 另一个解决方案是运行您自己的str_replace以恢复php部分,如果可行的话,并且不会引起任何安全漏洞。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM