question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Output nested headings as rubric

See original GitHub issue

This should be a quick fix when I’m back at my computer.

When a nested parse is called, e.g. by an admonition directive, match_title is set to False by default. (See https://github.com/live-clones/docutils/blob/bd16bdb302f5b24340ddaa69d109d419886bf0ac/docutils/docutils/parsers/rst/states.py#L257)

Then, when a heading underline is encountered in RST, this makes it ignore that heading and just log a warning (https://github.com/live-clones/docutils/blob/bd16bdb302f5b24340ddaa69d109d419886bf0ac/docutils/docutils/parsers/rst/states.py#L2419)

Currently in myst-parser, an error is correctly logged, but also the heading is still parsed. This can really mess up the resulting AST structure. Instead of ignoring it though, I think it would be a nice behaviour to still log the warning (which can be suppressed in sphinx) but then output the heading as a rubric, which does not affect the AST structure.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
danieleadescommented, Nov 28, 2022

nested_parse_with_titles solves it for me!

1reaction
chrisjsewellcommented, Nov 28, 2022

Hey @danieleades well then match_title should be equal to True, so then this is bypassed

Read more comments on GitHub >

github_iconTop Results From Across the Web

Heading Levels - More APA Style Guidelines - Academic Guides
Headings clarify your logic and organization for the reader by establishing a hierarchy of sections in the paper. If you have a subheading...
Read more >
Headings | Journals - Oxford Academic
Differentiate your heading types by using formatting or numbering. 'Nest' your headings appropriately—a level 2 heading should always be nested below a level...
Read more >
How can i Remove "(Continued)" from 2nd page? - TeX
I am writing a CV. After writing a couple of headers and sub-headers it jumps to the next page ...
Read more >
Prevent sub-section nesting in Python Sphinx when using ...
The only options seemed to be either remove the sub-heading ('Overview' in the example above) or mark it up as a rubric, e.g....
Read more >
SharePoint Navigation Sub Headings
Hi Our site contains headings and subheadings on the navigation menu: I am now no longer able to edit, remove or add new...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found