Skip to content

HTML container class does not use correct heading level #773

@drivet

Description

@drivet

Hi there,

I'm not sure if this is the correct behaviour, but looking at this page:

https://ox-hugo.scripter.co/test/posts/html-container-with-class/

I feel like the class attached to the HTML container doesn't match the heading it's wrapping. For example, you have this:

Top level heading 2 [#](https://ox-hugo.scripter.co/test/posts/html-container-with-class/#top-level-heading-2)

This heading is wrapped in a section tag with classes outline-2 and bar.

But when I inspect the HTML, it looks like this:

<section class="outline-1 bar">
<h2 id="top-level-heading-2">Top level heading 2
  <a href="#top-level-heading-2"><small>#</small></a>
</h2>
...
</section>

which seems to contradict the text.

I'm also noticing that behaviour in my own projects. No matter what top-level heading I use in my org file, the markdown heading will be a level 2, and the wrapping class will be outline-1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions