Skip to content

Headers containing links result in invalid HTML; nested a tags #221

Open
@ollie27

Description

@ollie27

If a header contains a link like the following it will result in nested a tags which is invalid.

## Header with [link](https://example.com).

This results in:

<a class="header" href="foo.html#header-with-a-hrefhttpsexamplecomlinka" name="header-with-a-hrefhttpsexamplecomlinka"><h2>Header with <a href="https://example.com/">link</a>.</h2></a>

A possible solution is to put the anchor at the start or end of the header rather than around the whole thing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LinksArea: Issues with linksA-RenderingArea: RenderingC-bugCategory: A bug, incorrect or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions