瀏覽代碼

[minor] html_utils.py, bleach.linkify remove tokenizer

version-14
Rushabh Mehta 8 年之前
父節點
當前提交
2e1d0fe71e
共有 1 個檔案被更改,包括 1 行新增9 行删除
  1. +1
    -9
      frappe/utils/html_utils.py

+ 1
- 9
frappe/utils/html_utils.py 查看文件

@@ -24,15 +24,7 @@ def sanitize_html(html, linkify=False):
escaped_html = bleach.clean(html, tags=tags, attributes=attributes, styles=styles, strip_comments=strip_comments)

if linkify:
# based on bleach.clean
class s(bleach.BleachSanitizer):
allowed_elements = tags
allowed_attributes = attributes
allowed_css_properties = styles
strip_disallowed_elements = False
strip_html_comments = strip_comments

escaped_html = bleach.linkify(escaped_html, tokenizer=s)
escaped_html = bleach.linkify(escaped_html, callbacks=[])

return escaped_html



Loading…
取消
儲存