Skip to content
This repository has been archived by the owner on Jan 25, 2019. It is now read-only.

Fix: rst - wrong handling of initial lonely heading #152

Merged
merged 2 commits into from
Sep 1, 2016

Conversation

gchriz
Copy link
Contributor

@gchriz gchriz commented Jan 14, 2016

Fixes issue #124

Problem:

A lone initial heading isn't handled correctly.
It's treated as document title and as result is missing as topic heading.

Example:

heading1
========

some text

heading2
--------

more text

gives (shortened):

<p>some text</p>
<h1>heading2</h1>
<p>more text</p>

See: http://docutils.sourceforge.net/docs/api/publisher.html#publish-parts-details
http://docutils.sourceforge.net/FAQ.html#unexpected-results-from-tools-rst2html-py-h1-h1-instead-of-h1-h2-why

Solution:

Disable the promotion of a lone top-level section title to document title
(and subsequent section title to document subtitle promotion)

See: http://docutils.sourceforge.net/docs/api/publisher.html#id3
http://docutils.sourceforge.net/docs/user/config.html#doctitle-xform

Problem:

A lone initial heading isn't handled correctly.
It's treated as document title and as result is missing as topic heading.

Example:

    heading1
    ========

    some text

    heading2
    --------

    more text

gives (shortened):

    <p>some text</p>
    <h1>heading2</h1>
    <p>more text</p>

See: http://docutils.sourceforge.net/docs/api/publisher.html#publish-parts-details
     http://docutils.sourceforge.net/FAQ.html#unexpected-results-from-tools-rst2html-py-h1-h1-instead-of-h1-h2-why

Solution:

Disable the promotion of a lone top-level section title to document title
(and subsequent section title to document subtitle promotion)

See: http://docutils.sourceforge.net/docs/api/publisher.html#id3
     http://docutils.sourceforge.net/docs/user/config.html#doctitle-xform
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants