Fantomas42/django-blog-zinnia — Issue #114: linebreaks(self.content) breaks EntryPlaceholder HTML
Author: philomat
Created: 2011-11-12 02:36:20+00:00
State: open

Since EntryPlaceholder content may contain anything, for instance Javascript code, the linebreaks() call will often break the output. Also, it is not necessary since the CMS plugins take care of their own formatting.

Suggesting this working fix (override html_content()):

"""Placeholder model for Zinnia"""
from cms.models.fields import PlaceholderField

from zinnia.models import EntryAbstractClass

class EntryPlaceholder(EntryAbstractClass):
"""Entry with a Placeholder to edit content"""

content_placeholder = PlaceholderField('content')

class Meta:
"""EntryPlaceholder's Meta"""
abstract = True

@property
def html_content(self):
"""No additional formatting is necessary"""
return self.content