📄 simple.php
字号:
<?phprequire_once 'HTMLPurifier/TagTransform.php';/** * Simple transformation, just change tag name to something else, * and possibly add some styling. This will cover most of the deprecated * tag cases. */class HTMLPurifier_TagTransform_Simple extends HTMLPurifier_TagTransform{ var $style; /** * @param $transform_to Tag name to transform to. * @param $style CSS style to add to the tag */ function HTMLPurifier_TagTransform_Simple($transform_to, $style = null) { $this->transform_to = $transform_to; $this->style = $style; } function transform($tag, $config, &$context) { $new_tag = $tag->copy(); $new_tag->name = $this->transform_to; if (!is_null($this->style) && ($new_tag->type == 'start' || $new_tag->type == 'empty') ) { $this->prependCSS($new_tag->attr, $this->style); } return $new_tag; } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -