Skip to content

Headings with just punctuation do not generate a linkable ID #3002

@ehuss

Description

@ehuss

Problem

If there is a heading with just punctuation, like ## ::, this generates a somewhat nonsense id="" and href="#", preventing links to the header from working.

Steps

  1. Have a header with just punctuation.

Possible Solution(s)

See id_from_content for how the filtering works.

I'm not sure what the best approach would be. I think generating some relatively unique ID might be the best path (like some prefix with a number?). I checked GitHub, and it has the same behavior of generating id="". It might be interesting to see if any other tools support this.

Notes

No response

Version

mdbook v0.5.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-HTMLArea: HTML 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