Skip to content

Remove zwsp characters from mdx files - #38

Open
humtta wants to merge 1 commit into
jetify-com:mainfrom
humtta-forks:fix/remove-zwsp-characters
Open

Remove zwsp characters from mdx files#38
humtta wants to merge 1 commit into
jetify-com:mainfrom
humtta-forks:fix/remove-zwsp-characters

Conversation

@humtta

Copy link
Copy Markdown

While browsing the documentation, I noticed that the heading permalinks had a strange format, like:

https://www.jetify.com/docs/devbox/devbox-global#bash%E2%80%8B
https://www.jetify.com/docs/devbox/devbox-global#zsh%E2%80%8B
https://www.jetify.com/docs/devbox/devbox-global#fish%E2%80%8B

Whereas the expected format would be:

https://www.jetify.com/docs/devbox/devbox-global#bash
https://www.jetify.com/docs/devbox/devbox-global#zsh
https://www.jetify.com/docs/devbox/devbox-global#fish

While inspecting the contents of the docs/devbox/devbox-global/index.mdx file using the bat -A command, I noticed several occurrences of zero-width space (ZWSP) characters. For example:

80 │ ###·Bash[\u{200b}](#bash·"Direct·link·to·Bash")␊
90 │ ###·Zsh[\u{200b}](#zsh·"Direct·link·to·Zsh")␊
98 │ ###·Fish[\u{200b}](#fish·"Direct·link·to·Fish")␊

The Unicode character U+200B is encoded as the UTF-8 bytes E2 80 8B, which explains the %E2%80%8B suffix found in heading permalinks.

This PR removes all these ZWSP characters from the .mdx files. This was done with a script I wrote, using this command:

curl -fsSL https://gist.github.com/humtta/97a3193eaa779f55062057f28b0a78d8/raw/remove-zwsp.sh \
| bash -s -- **/*.mdx

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@humtta