You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
parts['fragment'] returns body content only from header 3, which is in agreement with the docutils documentation:
parts['fragment'] contains the document body (not the HTML ). In other words, it contains the entire document, less the document title, subtitle, docinfo, header, and footer.
Proposed solution.
Use parts['html_body'] instead of parts['fragment']:
#14.
This changes how the document is fetched from the rST renderer. Before it was fetching the actual document fragment while now it fetches the entire document body including the main and subtitle.
If you prefer the previous behavior, this is easily changed by subclassing the Filter class and adjust the part name:
```
class OldStyleRstMarkupFilter(RstMarkupFilter):
rst_part_name = 'fragment'
```
Problem
This classical restructured text formatting for section headers is not rendered as expected by django_markup.
Header 1 & 2 are pure and simply forgotten.
Diagnotic
After some investigations,
django_markup
usesdocutils.core.publish_parts
to render rst.django_markup
uses this code to render rst:parts['fragment']
returns body content only from header 3, which is in agreement with the docutils documentation:Proposed solution.
Use
parts['html_body']
instead ofparts['fragment']
:The text was updated successfully, but these errors were encountered: