Say you want to create an indented list in a comment intended for a markdown template
/**
- Level one
- Level two
- Level three
*/
One would expect:
Level one
Level two
Level three
But instead, the leading spaces are removed in the .Description template field turning the output into:
Level one
Level two
Level three
If, to avoid breaking peoples' existing templates, a new field was added for Descriptions that was untouched by the ParseComments then scrub function, then the template could pull in the Raw Description and process it using the sprig template functions if things needed to be trimmed.
Edit: It seems as if the protoc-gen-go code is the culprit for stripping out spaces in block comments. As a workaround, you can use regular comments to avoid having leading spaces being stripped.
Say you want to create an indented list in a comment intended for a markdown template
One would expect:
But instead, the leading spaces are removed in the .Description template field turning the output into:
If, to avoid breaking peoples' existing templates, a new field was added for Descriptions that was untouched by the ParseComments then scrub function, then the template could pull in the Raw Description and process it using the sprig template functions if things needed to be trimmed.
Edit: It seems as if the
protoc-gen-go
code is the culprit for stripping out spaces in block comments. As a workaround, you can use regular comments to avoid having leading spaces being stripped.