Applicable when autoHeadingIDType is either `github` or `github-ascii`.
When autoHeadingIDType is `blackfriday`, the existing code removes
trailing whitespace while iterating through the characters, using
a boolean "futureDash" mechanism.
Fixes #6798
b = text.RemoveAccents(b)
}
+ b = bytes.TrimSpace(b)
+
for len(b) > 0 {
r, size := utf8.DecodeRune(b)
switch {
testlines, expectlines := strings.Split(tests, "\n"), strings.Split(expect, "\n")
+ testlines = append(testlines, "Trailing Space ")
+ expectlines = append(expectlines, "trailing-space")
+
if len(testlines) != len(expectlines) {
panic("test setup failed")
}