Skip to content

toc: true with gfm does not produce valid link for Github when special char in headers #4917

@cderv

Description

@cderv

This was reported by @mine-cetinkaya-rundel

---
title: "Untitled"
format: gfm
toc: true
---

# A header

# With ending dot.

# With a.dot in the middle

will render to

# Untitled

- [A header](#a-header)
- [With ending dot.](#with-ending-dot.)
- [With a.dot in the middle](#with-a.dot-in-the-middle)

# A header

# With ending dot.

# With a.dot in the middle

The dots are not removed from the identifier produced in TOC. Pasting this markdown in Github will have unfunctional TOC

This is because in Pandoc gfm_auto_identifiers which remove the punctuation like on Github is only a reader extensions - see jgm/pandoc#8709

This means that setting toc: true with GFM format does not work really - I think we could add +gfm_auto_identifiers to the reader extension markdown so that we produce valid TOC - if that is possible...

Metadata

Metadata

Labels

bugSomething isn't workingupstreamBug is in upstream library

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions