reflow
reflow copied to clipboard
Dedent incorrectly removes spaces that aren't at the start of a line
When a string has lines with no indentation and lines with indentations, the dedented string will remove the first spaces within the line instead of just at the start.
package main
import (
"fmt"
"github.com/muesli/reflow/dedent"
)
func main() {
input := `This is an example
with no shared indent.`
fmt.Println(dedent.String(input))
}
The output will be:
Thisisan example
with no shared indent.
https://go.dev/play/p/Q13CeRD8Tb2