# coding=utf-8
from django.db import models

from utils.xss_filter import XssHtml


class RichTextField(models.TextField):
    __metaclass__ = models.SubfieldBase

    def get_prep_value(self, value):
        parser = XssHtml()
        parser.feed(value)
        parser.close()
        return parser.getHtml()
@@ -194,16 +194,63 @@
 value):%0A
+        if not value:%0A            return value%0A
         

修复None 导致的 xss filter 工作异常