Skip to content
Browse files

Merge pull request #419 from lmorchard/generate-section-ids-after-kum…

…ascript-769399

bug 769399: Stop generating IDs as part of document save, wait until after kumascript processing
  • Loading branch information...
2 parents 76ef290 + 7f678a4 commit 103c86ffc7e0fb119c75a59145c0b72cc47250da @groovecoder groovecoder committed Jul 19, 2012
Showing with 9 additions and 9 deletions.
  1. +0 −5 apps/wiki/models.py
  2. +9 −4 apps/wiki/views.py
View
5 apps/wiki/models.py
@@ -1221,11 +1221,6 @@ def save(self, *args, **kwargs):
'to a revision of the default-'
'language document.')
- if self.content and not self.document.is_template:
- self.content = (wiki.content
- .parse(self.content)
- .injectSectionIDs()
- .serialize())
if not self.title:
self.title = self.document.title
if not self.slug:
View
13 apps/wiki/views.py
@@ -334,14 +334,19 @@ def set_common_headers(r):
toc_html = None
if not doc.is_template:
+ doc_html = (wiki.content.parse(doc_html)
+ .injectSectionIDs()
+ .serialize())
+
# Start applying some filters to the document HTML
- tool = wiki.content.parse(doc_html)
- doc_html = tool.serialize()
+ tool = (wiki.content.parse(doc_html))
+
# Generate a TOC for the document using the sections provided by
# SectionEditingLinks
if doc.show_toc and not show_raw:
- toc_html = wiki.content.parse(doc_html).filter(
- wiki.content.SectionTOCFilter).serialize()
+ toc_html = (wiki.content.parse(tool.serialize())
+ .filter(wiki.content.SectionTOCFilter)
+ .serialize())
# If a section ID is specified, extract that section.
if section_id:

0 comments on commit 103c86f

Please sign in to comment.
Something went wrong with that request. Please try again.