Explicit section not possible?

+++ Randomstuff [Oct 29 14 22:49 ]:

AFAIU, the current spec treats this snippet as a flat AST such as:

  • h1: Foo
  • h2: Bar
  • paragraph: p

If it was treated as this instead:

  • h1: Foo
  • section
    • h1: Bar
  • paragraph: p

it would make the hierachiecal interpretation standard instead of relying on the implementation to rebuild the structure from the flat view.

Well, in Markdown these two documents are different:

# Foo

### Bar
p
# Foo

## Bar
p

On your proposal, as I understand it, they’d be parsed into the same AST, so there’d be no way to go back; information would be lost. The problem is that there are multiple flat structures corresponding to a single hierarchical structure.