When generating markdown docs, we often get extra newlines that are hard to fix with Go templates themselves (while still handling all possible cases). The semantics of {{- and -}} seem too limited for this purpose.
I'm open to anyone trying to fix all the cases of unnecessary newlines using templating, but another idea is to rather run a post-processor (maybe a markdown formatter?) on the files to make them uniform. It might be as simple as replacing 3+ occurrences of \nwith \n\n.
When generating markdown docs, we often get extra newlines that are hard to fix with Go templates themselves (while still handling all possible cases). The semantics of
{{-and-}}seem too limited for this purpose.I'm open to anyone trying to fix all the cases of unnecessary newlines using templating, but another idea is to rather run a post-processor (maybe a markdown formatter?) on the files to make them uniform. It might be as simple as replacing 3+ occurrences of
\nwith\n\n.