Skip to content

Render H1 elements added via autoHeader as anchors #516

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:

<h1id="title"><ahref="#/?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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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