Menu

#505 Curious repeated paragraph

closed-fixed
nobody
None
5
2025-07-30
2025-06-26
Harmen
No

When the following is parsed, the line that says "this is repeated" appears twice as a paragraph.

=========
section 1
=========

---
abc
---

this is repeated

=========
section 2
=========

It is fixed by:

  1. Adding an additional newline after the sentence
  2. Using 4 hyphens ---- instead of 3 --- above and below abc
  3. Removing the upper ---

Pandoc renders this as expected (at least by me).

Discussion

  • engelbert gruber

    sections do not have overlines (upper) only the document title

     
  • Harmen

    Harmen - 2025-06-28

    Fair point, but a bug nonetheless.

     
  • Harmen

    Harmen - 2025-06-28

    @grubert actually that is not documented: https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html

    I think the example should be fine according to that specification.

    In any case, it's a bug to have the paragraph repeated.

     
    • engelbert gruber

      you are completely right, i just happened to never have used upperlines

      but now i know how put chapter titles

      please bear with me, if this is not fixed in 0.22

      cheers and many thanks

       

      Last edit: Günter Milde 2025-07-20
  • engelbert gruber

    could you test with the prerelease

    make a env, install latest release candidate

    mkdir testdir
    cd testdir
    python3 -m venv .
    . bin/activate
    pip install --pre docutils
    

    run the test
    rst2html dbl-par.rst

    i do not get duplication

     
  • Günter Milde

    Günter Milde - 2025-07-20
    • status: open --> open-fixed
     
  • Günter Milde

    Günter Milde - 2025-07-20

    This seems to be by-effect of the legacy algorithm for parsing section titles (cf. [bugs:#346]).
    This is fixed by [patches:#213].

     

    Related

    Bugs: #346
    Patches: #213


    Last edit: Günter Milde 2025-07-20
  • Günter Milde

    Günter Milde - 2025-07-30
    • status: open-fixed --> closed-fixed
     
  • Günter Milde

    Günter Milde - 2025-07-30

    The bug is fixed in Docutils 0.22 released 2025-07-29.
    Thank you for reporting.

     

Log in to post a comment.

MongoDB Logo MongoDB