kubectl/pkg/util/templates
Arda Güçlü a9dd2e4bec Preserve code blocks in templates.Normalizer (#118029)
* Preserve code blocks in templates.Normalizer

Currently, if templates.LongDesc function is invoked multiple times
for a string including a code block, this code block is converted to
invalid code block.

The reason of this issue is that blackfriday package, which templates package uses, relies on
4 * indentation to detect code blocks. This PR always preserves
4 * indentation in code blocks to always detect it code blocks in also
post invocations.

* Add indentations to test for code blocks

* Use strings.repeat for repetition

Kubernetes-commit: 0bff705acd8982e34b937116eb2016c9d6e4c4a6
2023-05-24 09:20:49 +03:00
..
command_groups.go Moved pkg/kubectl/util/term, pkg/kubectl/util/templates, pkg/kubectl/util/interrupt, and pkg/kubectl/util/interrupt to staging 2019-06-19 16:31:38 +02:00
help_flags_printer.go Beautify kubectl help flag commands 2021-09-02 13:41:07 -04:00
markdown.go Preserve code blocks in templates.Normalizer (#118029) 2023-05-24 09:20:49 +03:00
normalizers.go add unit test for normalizer rendering markdown 2022-09-27 14:06:40 +08:00
normalizers_test.go Preserve code blocks in templates.Normalizer (#118029) 2023-05-24 09:20:49 +03:00
templater.go Do not wrap lines if we can't read term size 2022-04-29 14:01:14 +02:00
templates.go Moved pkg/kubectl/util/term, pkg/kubectl/util/templates, pkg/kubectl/util/interrupt, and pkg/kubectl/util/interrupt to staging 2019-06-19 16:31:38 +02:00