Open lifeparticle opened 5 months ago
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/markdown \
-d '{"text":"# Reference issues and pull requests \n # Mention people and teams", "mode": "markdown"}'
<div class="markdown-heading"><h1 class="heading-element">Reference issues and pull requests</h1><a id="user-content-reference-issues-and-pull-requests" class="anchor" aria-label="Permalink: Reference issues and pull requests" href="#reference-issues-and-pull-requests"><span aria-hidden="true" class="octicon octicon-link"></span></a></div>
<div class="markdown-heading"><h1 class="heading-element">Mention people and teams</h1><a id="user-content-mention-people-and-teams" class="anchor" aria-label="Permalink: Mention people and teams" href="#mention-people-and-teams"><span aria-hidden="true" class="octicon octicon-link"></span></a></div>
Looks to be a non-issue it was caused by the introduction of the ASCII character code 160 the non-breaking space. When generating the anchor navigation links, GitHub's markdown parser converts spaces to hyphens. In this particular case it was not happening due to the space character not being the standard ASCII space character code 30
DEC | OCT | HEX | BIN | Symbol | HTML Number | HTML Name | Description |
---|---|---|---|---|---|---|---|
32 | 040 | 20 | 00100000 | SP | \ | Â | Space |
160 | 240 | A0 | 10100000 | NBSP | \ | \ | Non-breaking space |
Other spaces characters to look out for but in the Unicode space are:
Code | HTML Entity | UTF-8 Encoding | UTF-16 Encoding | UTF-32 Encoding |
---|---|---|---|---|
U+2003 | \ \ \ |
0xE2 0x80 0x83 | 0x2003 | 0x00002003 |
U+2002 | |
0xE2 0x80 0x82 | 0x2002 | 0x00002002 |
A list of other possible spaces in Unicode can be found at the below link: https://www.compart.com/en/unicode/category/Zs
@MajorKeen many thanks for your detailed explanation, it make sense now. I will try to handle these special cases in the TOC generator.
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/markdown \
-d '{"text":"# Reference issues and pull requests \n # Mention people and teams", "mode": "markdown"}'
<div class="markdown-heading"><h1 class="heading-element">Reference issues and pull requests</h1><a id="user-content-reference-issues-and-pullrequests" class="anchor" aria-label="Permalink: Reference issues and pull requests" href="#reference-issues-and-pullrequests"><span aria-hidden="true" class="octicon octicon-link"></span></a></div>
<div class="markdown-heading"><h1 class="heading-element">Mention people and teams</h1><a id="user-content-mention-people-and-teams" class="anchor" aria-label="Permalink: Mention people and teams" href="#mention-people-and-teams"><span aria-hidden="true" class="octicon octicon-link"></span></a></div>
Steps to Reproduce:
Expected:
#mention-people-and-teams
#reference-issues-and-pull-requests
Actual:
#mention-people-andteams
#reference-issues-and-pullrequests
Impact: Broken navigation links.