Skip to content

Render H1 elements added via autoHeader as anchors #516

Closed
@jhildenbiddle

Description

@jhildenbiddle

When the autoHeader option is set to true, the following HTML is generated:

<h1>Title</h1>

But when an h1 tag is found in markdown, it is converted to the following HTML:

<h1 id="title">
  <a href="#/?id=title" data-id="title" class="anchor">
    <span>Title</span>
  </a>
</h1>

This inconsistency creates a few issues:

  1. These elements behave differently, but they shouldn't.
  2. These elements may not look the same if theme authors are using the additional attributes and/or HTML tags from the second example as hooks for styling
  3. These elements cannot be processed the same way by plugins

Summary: Render elements added via the autoHeader the same as header elements found in markdown.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugconfirmed as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions