Skip to content

Support configurable anchor slug style (e.g., "Zettlr‑style" stripping emojis/symbols) #414

@maximeescande

Description

@maximeescande

Description:

Currently, Marksman generates heading anchors following GitHub‑style slugs, preserving emojis/symbols:

## ⏸️🖥️ Break during work
→ becomes #⏸️🖥️-break-during-work

However, tools like Zettlr strip emojis and special characters—producing: #break-during-work

This mismatch breaks cross-tool clickable anchor links.
No existing issue appears in the repo concerning slug behavior.

Proposal:

Introduce a boolean configuration, e.g., slug_style = "zettlr" or strip_emojis = true, to allow users to generate sanitized anchors (lowercase, ASCII alphanumeric + hyphens).
Could be supported via CLI flag (--zettlr-anchors) or LSP server setting.

Steps / Implementation Sketch:

Modify slug generation (e.g., in lib/slug.rs) to optionally strip emojis and non-alphanumeric characters

Add config option in features.md

Add tests: emojis removed, slug matches break-during-work

Benefits:

Improves interoperability with Zettlr and other sanitized‑slug tools

Users can consistent linking across editors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions