Skip to content

nested <h2> elements break table of contents #567

@trebor

Description

@trebor

if a markdown page includes content like:

## Section Three

<h2>Lorem ipsum</h2>

it will cause the table of contents cursor to skip past the Section Three entry.

this is true even if the <h2> is embedded more deeply in html.

## Section Three

<div class="card">
  <h2>Lorem ipsum</h2>
</div>

this bug can be seen in the current CLI documentation for cards:

https://cli.observablehq.com/layout/card

Metadata

Metadata

Assignees

Labels

bugSomething isn’t working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions