Remove trailing hyphen from auto heading ID
authorJoe Mooring <joe.mooring@veriphor.com>
Sat, 4 Jul 2020 21:02:00 +0000 (17:02 -0400)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sun, 5 Jul 2020 12:13:02 +0000 (14:13 +0200)
commit58c0f5e6171cbf8e3ed8d73ac95a7b85168c5b2f
treebb849d03ded34d1a413ca55140f119ddef5ee3aa
parenta1c3e3c1f32bcbc3b3aa6921bdee98a9f795a2da
Remove trailing hyphen from auto heading ID

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
markup/goldmark/autoid.go
markup/goldmark/autoid_test.go