Closed wooorm closed 3 years ago
I was working today on reverse engineering GH, focussed on its slugging algo. I had to figure out whether spaces are handled part of the slugging algorithm, or trimmed. I couldn’t use mdast and mdast-util-to-markdown to put spaces in text around text inside headings, and instead had to hack an escape-hatch: https://github.com/Flet/github-slugger/pull/38/files#diff-04d6b519dad11fd7ce3eb27c6f96e888f7fd787421ffcaff49b3b1d2014ac04eR45.
mdast-util-to-markdown
Perhaps tabs and spaces around line breaks, such as a value of ' a ' in a heading, where both sides are next to a line break, those tabs and spaces need to be encoded as character references?
' a '
Status quo? 🤷♂️
Initial checklist
Problem
I was working today on reverse engineering GH, focussed on its slugging algo. I had to figure out whether spaces are handled part of the slugging algorithm, or trimmed. I couldn’t use mdast and
mdast-util-to-markdown
to put spaces in text around text inside headings, and instead had to hack an escape-hatch: https://github.com/Flet/github-slugger/pull/38/files#diff-04d6b519dad11fd7ce3eb27c6f96e888f7fd787421ffcaff49b3b1d2014ac04eR45.Solution
Perhaps tabs and spaces around line breaks, such as a value of
' a '
in a heading, where both sides are next to a line break, those tabs and spaces need to be encoded as character references?Alternatives
Status quo? 🤷♂️