Skip to content

RST section title including ".*" and without blank line after adornment characters wrongly renders as inline markup #9805

Closed
@fireattack

Description

@fireattack

Explain the problem.
This RST:

word.*word
------------
* abc

should be converted to an h2 heading with title "word.*word", and a bullet list of "abc".

However, it would be converted to (in MD, for example):

word.*word ------------* abc

which means it recognizes these two asterisks as inline markups.

You can "fix" it by adding a blank line after the ------------, but you shouldn't need to.

According to the spec, https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#sections

A blank line after a title is optional.

You can also "fix" it by removing . in front of * (i.e. change to word*word), but you shouldn't need to do this either; because this example does not match the rule for "inline markup recognition rule":
https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#inline-markup-recognition-rules

  1. Inline markup start-strings must start a text block or be immediately preceded by
    • whitespace,
    • one of the ASCII characters - : / ' " < ( [ {
    • or a similar non-ASCII punctuation character. [19]

As you can see, . (period) is NOT in the list of must-precede-the-markup list of characters (which are- : / ' " < ( [ { \s). Therefore, the first asterisk should NOT be recognized as markup, but literal asterisk.

Pandoc version?

3.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions