Skip to content

Tidy: Remove redundant named anchors #16

@jhermann

Description

@jhermann

Named or link-less anchors around or in a header (H1…5) can result from copy-pasting HTML into a page. They tend to bleed into the surrounding text when using the "rich" editor of the latest releases (after saving, the new DOM is dirtied with the duplicates). This creates a visual problem, since the default CSS does not discriminate between normal links and named anchors.

Add some code that removes any Anchor nodes with the same name attribute, except the first one. Or put another way, replace any duplicate anchor node with its children, or morph it into a span.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions