Only render content once
This commit is contained in:
parent
4e177f9400
commit
489a212b7a
1 changed files with 6 additions and 2 deletions
|
@ -83,11 +83,15 @@ class BaseContentMixin(models.Model):
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def body_html(self) -> str:
|
def body_html(self) -> str:
|
||||||
return add_heading_anchors(str(self.body))
|
return add_heading_anchors(self._body_html)
|
||||||
|
|
||||||
|
@cached_property
|
||||||
|
def _body_html(self) -> str:
|
||||||
|
return str(self.body)
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def content_html(self) -> str:
|
def content_html(self) -> str:
|
||||||
return get_content_html(str(self.body))
|
return get_content_html(self._body_html)
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def plain_text(self) -> str:
|
def plain_text(self) -> str:
|
||||||
|
|
Loading…
Reference in a new issue