Skip to content

Commit

Permalink
Fixing #4.
Browse files Browse the repository at this point in the history
  • Loading branch information
mitar committed Feb 11, 2013
1 parent fb0f857 commit f9ba86a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmsplugin_markup/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def save(self, *args, **kwargs):
# We store it in any case to also check the parser for possible exceptions and to use it for __unicode__
(content, parser) = utils.markup_parser(self.body, self.markup)
self.body_html = content
self.body_scripts = parser.get_scripts()
self.body_stylesheets = parser.get_stylesheets()
self.body_scripts = '\n'.join(parser.get_scripts())
self.body_stylesheets = '\n'.join(parser.get_stylesheets())
if not utils.get_markup_object(self.markup).is_dynamic:
self.dynamic = False
return super(MarkupField, self).save(*args, **kwargs)
Expand All @@ -46,8 +46,8 @@ def render(self, context):
context['markup_stylesheets'] = context.get('markup_stylesheets', []) + parser.get_stylesheets()
return mark_safe(content)
else:
context['markup_scripts'] = context.get('markup_scripts', []) + self.body_scripts
context['markup_stylesheets'] = context.get('markup_stylesheets', []) + self.body_stylesheets
context['markup_scripts'] = context.get('markup_scripts', []) + self.body_scripts.split('\n')
context['markup_stylesheets'] = context.get('markup_stylesheets', []) + self.body_stylesheets.split('\n')
return mark_safe(self.body_html)

def clean_plugins(self):
Expand Down

0 comments on commit f9ba86a

Please sign in to comment.