comparableSource reduces a destination read straight from the source to that same form. It still carries the syntax goldmark had already removed: the whitespace separating the destination from the rest of the link, and the angle brackets that let a destination hold a space. Whitespace inside those b
(raw string)
| 449 | // angle brackets that let a destination hold a space. Whitespace inside those |
| 450 | // brackets is part of the name, so only the whitespace outside them goes. |
| 451 | func comparableSource(raw string) string { |
| 452 | return comparableDestination(trimAngles(strings.TrimSpace(raw))) |
| 453 | } |
| 454 | |
| 455 | func trimAngles(s string) string { |
| 456 | if len(s) >= 2 && s[0] == '<' && s[len(s)-1] == '>' { |
no test coverage detected