Description

Pages using #format rst have the wrong HTML tags generated for headings. The sequence generated for level 1, 2, and 3 headings is: <h1>, <h3>, <h4>, ...), skipping the <h2> level tag.

For wiki-format markup pages, the HTML heading tags a generated as expected (<h1>, <h2>, <h3>, ...).

Steps to reproduce

  1. Show that a reStructuredText formatted page skips the <h2> tag. Enter this into a wiki page:

    #format rst
    
    Level 1 Heading
    ===============
    
    Some text.
    
    Level 2 Heading
    ---------------
    
    More text.
    
    Level 3 Heading
    ~~~~~~~~~~~~~~~
    
    Blah blah blah.
    It produces this HTML:
    <div dir="ltr" id="preview" lang="en"><span class="anchor" id="top-1"></span>
    <h1>Level 1 Heading</h1>
    <p>Some text.</p>
    <div class="section">
    <h3><a id="level-2-heading" name="level-2-heading">Level 2 Heading</a></h3>
    <p>More text.</p>
    <div class="section">
    <h4><a id="level-3-heading" name="level-3-heading">Level 3 Heading</a></h4>
    <p>Blah blah blah.</p>
    </div>
    </div>

    Note that the level 2 heading is generated with an <h3> tag.

  2. Compare with the same page written using wiki markup. Enter the following as a wiki page:
    #format wiki
    
    = Level 1 Heading =
    
    Some text.
    
    == Level 2 Heading ==
    
    More text.
    
    === Level 3 Heading ===
    
    Blah blah blah.
    It produces this HTML:
    <h1 id="Level1Heading">Level 1 Heading</h1>
    <span class="anchor" id="line-4"></span>
    <span class="anchor" id="line-5"></span><p class="line874">Some text. 
    <span class="anchor" id="line-6"></span><span class="anchor" id="line-7"></span></p>
    <p class="line867"></p>
    <h2 id="Level2Heading">Level 2 Heading</h2>
    <span class="anchor" id="line-8"></span>
    <span class="anchor" id="line-9"></span>
    <p class="line874">More text. 
    <span class="anchor" id="line-10">
    </span><span class="anchor" id="line-11"></span></p>
    <p class="line867">
    </p><h3 id="Level3Heading">Level 3 Heading</h3>
    <span class="anchor" id="line-12">
    </span><span class="anchor" id="line-13"></span>
    <p class="line874">Blah blah blah. 
    <span class="anchor" id="line-14"></span>
    <span class="anchor" id="bottom"></span></p>

    Note that with the wiki-marked up page, the level 2 heading is generated with an <h2> tag as expected.

Example

See "Steps to reproduce" above for the example.

Component selection

Details

MoinMoin Version

1.7.1

OS and Version

Linux 2.6.26 (GNU/Linux, Gentoo Linux 2008.0)

Python Version

2.5.2

Server Setup

Standalone

Server Details

Standalone -- just running bin/moin to execute the MoinMoin server.

Language you are using the wiki in (set in the browser/UserPreferences)

en

Docutils Version

0.4

Workaround

Live with poorly formatted pages (level 2 headings (really level 3!) are way too small!) or use wiki markup instead of reStructuredText.

Discussion

I will take a look at the MoinMoin source myself and see if it is simple enough that a Python/MoinMoin novice like me can fix it. -- ColinBennett 2008-07-30 18:55:15

Plan


CategoryMoinMoinBug CategoryMoinMoinBug

MoinMoin: MoinMoinBugs/ReStructuredTextSkipsH2Heading (last edited 2008-07-30 18:55:15 by ColinBennett)