Skip to content

h1 is wrapped in header tag even when title is provided in yaml (website project) #12980

Open

Description

@rmvegasm

Hi,

I've noticed quarto is wrapping the first h1 heading into a separate header tag since version 1.6. I went through the discussion in issue #11618 and learned this is in part intended behavior. However, I think what I'm seeing might not be part of the desired functionality...

This is a minimal example:

index.qmd

::: {#custom-div}
# Div title

Some words as div's content

:::

_quarto.yml

project:
  type: website

website:
  title: 'Heading in header issue'

The output produced by quarto render on these files is

<!-- main -->
<main class="content" id="quarto-document-content">

<header id="title-block-header" class="quarto-title-block">
<h1 class="title display-7">Div title</h1>
</header>

<div id="custom-div">
<section id="div-title" class="level1">

<p>Some words as div’s content</p>
</section>
</div>

</main>
<!-- /main -->

Within the referenced issue I read something like this, where the first h1 heading is contained within a div, should not be used as the page title nor taken outside that div. This is exactly the behavior I observe when rendering a single file to html. However, when using the website project structure, and even though there's an explicit title provided for the project, the first h1 heading gets wrapped into a separate header tag and separated from the containing div in the source.

Is this intentional? Happy to help where I can.

Note

Using quarto v1.7.32 (CLI) on debian bookworm.

Activity

  1. mcanouil commented on Jun 24, 2025

    @mcanouil
    Collaborator

    In the future, please use the issue template to ensure the team has all the information it needs.

    Also, if you want to ask a question about a behaviour, as documented in the issue templates, prefer the discussion board.

  2. mcanouil commented on Jun 24, 2025

    @mcanouil
    Collaborator

    The <header> seems to be an oversight from previous PRs.

    It gets a bit weirder if you change your index.qmd with:

    # Header
    
    ::: {#custom-div}
    # Div title
    
    Some words as div's content
    
    :::

    # Header is not the one being promoted to the title block.

  3. added
    bug
    websites
    on Jun 24, 2025
  4. self-assigned this
    on Jun 30, 2025
  5. added this to the Future milestone on Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugwebsites

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions