Closed NonSwag closed 4 months ago
Would be nice if the Markdown format was consistent
hahahhahaha
markdown sadly is extremely underspec'd and everybody implements it differently. there is no standard. github doesnt document their impl, the original markdown spec (that nobody follows and was already underspec'd) doesn't even include section links, neither does the good (but different from gfm) commonmark spec.
I found a lib that does attempt to emulate githubs slug parsing and used that to generate headings instead: https://github.com/Flet/github-slugger
while at it, also added a toc section.
thanks for the hard work :+1:
Observed/problematic behavior
Hangar replaces some symbols used in URLs generated for headings different than GitHub.
I only noticed two characters so far:
/
and.
on Hangar are replaced with-
but completely stripped on GitHubThe problem with this is that for example TOCs (table of contents) do not work in some cases
Expected behavior
Would be nice if the Markdown format was consistent across GitHub and Hangar
Steps to reproduce
Create headings inside a markdown file containing
/
and or.
on Hangar and GitHub Create a TOC and try to use it.Other
No response