Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strip headings for readability / wikilinks compatibility #34

Merged
merged 1 commit into from
Feb 18, 2024

Conversation

johansatge
Copy link
Owner

@johansatge johansatge commented Feb 18, 2024

The plugin uses wikilinks to generate a clickable table of contents (see in this PR why wiklinks and not markdown links) but wiklinks don't support formatting; this link for instance:

[[#some-anchor|Some **text** with <em>emphasis</em>]]

will render as:

Some **text** with <em>emphasis</em>

So let's strip markdown & HTML markup from headings when generating the TOC. So the text will lose its formatting, but be readable:

Some text with emphasis

And don't apply stripping if includeLinks: false

@johansatge johansatge self-assigned this Feb 18, 2024
@johansatge johansatge force-pushed the strip-headings branch 2 times, most recently from 90f4868 to f8aa33f Compare February 18, 2024 11:05
@johansatge johansatge merged commit 3b3f169 into main Feb 18, 2024
1 check passed
@johansatge johansatge deleted the strip-headings branch February 18, 2024 11:14
@johansatge johansatge mentioned this pull request Feb 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant