diff --git a/rich_editor/parser.py b/rich_editor/parser.py index 4f7f05c8c..0fe7fbae5 100644 --- a/rich_editor/parser.py +++ b/rich_editor/parser.py @@ -1,10 +1,11 @@ # -*- coding: utf-8 -*- -import re - import StringIO import copy +import re + from django.core.exceptions import ValidationError from django.core.validators import URLValidator +from django.template.defaultfilters import linebreaks_filter from django.utils.html import escape from common_utils import build_absolute_uri @@ -580,7 +581,7 @@ def get_attributes(self): class TextParser: def parse(self, text): - self.output = escape(text) + self.output = linebreaks_filter(escape(text)) def get_output(self): return self.output