-
Notifications
You must be signed in to change notification settings - Fork 38.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preserve code blocks in templates.Normalizer #118029
Preserve code blocks in templates.Normalizer #118029
Conversation
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.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ardaguclu The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold |
/triage accepted |
/test pull-kubernetes-conformance-kind-ga-only-parallel |
@pacoxu would you mind taking a look at this fix?. Does it make sense?. Thanks. |
/lgtm |
LGTM label has been added. Git tree hash: 43fadb6863d5708090c772ece06f53c1f93103ca
|
/label tide/merge-method-squash |
/hold cancel |
* 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
What type of PR is this?
/kind bug
What this PR does / why we need it:
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.
Which issue(s) this PR fixes:
Fixes #118028
Special notes for your reviewer:
/assign @pacoxu
Does this PR introduce a user-facing change?