Allow multi-line code snippets in Markdown tables - #310
Open
adutra wants to merge 1 commit into
Open
Conversation
Owner
|
Gotta resolve your merge conflicts |
adutra
force-pushed
the
markdown-multiline
branch
from
March 5, 2026 08:58
1fd3ecd to
c7097ad
Compare
Contributor
Author
Fixed, sorry about that. |
Contributor
Author
|
FYI there might be a small regression for people doing custom values with Markdown markup. For example: # -- The foo value.
# @default -- Default is `bar` or `qix`.
foo: ~Now this would have to be changed to: # -- The foo value.
# @default -- Default is <code>bar</code> or <code>qix</code>.
foo: ~ |
This change enhances the `chart.valueDefaultColumnRenderMd` template which now uses multi-line code snippets with `<pre>` tags. The default values are rendered with a new template: `chart.valueDefaultColumnRenderInline`. Any line breaks are replaced with `<br/>` since Markdown table cells cannot have line breaks. HTML is properly escaped when default values are surrounded by backticks, e.g. `` `<span>foo</span>` `` is rendered as `<pre><span>foo</span></pre>`, but `<span>foo</span>` is rendered as `<pre><span>foo</span></pre>` without escaping. This behavior matches the existing behavior for Markdown tables. The "tpl" notation type is also supported. The motivation for this change is that Markdown tables are generally better rendered by websites like Hugo than HTML tables, but single-line snippets often make the "Default" column too wide and the overall table layout becomes unbalanced.
adutra
force-pushed
the
markdown-multiline
branch
from
March 5, 2026 09:24
c7097ad to
2396a87
Compare
Contributor
Author
|
@norwoodj would you have some time soon to have a look? Thanks! 🙏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change enhances the
chart.valueDefaultColumnRenderMdtemplate which now uses multi-line code snippets with<pre>tags.The default values are rendered with a new template:
chart.valueDefaultColumnRenderInline. Any line breaks are replaced with<br/>since Markdown table cells cannot have line breaks.HTML is properly escaped when default values are surrounded by backticks, e.g.
`<span>foo</span>`is rendered as<pre><span>foo</span></pre>, but<span>foo</span>is rendered as<pre><span>foo</span></pre>without escaping. This behavior matches the existing behavior for Markdown tables.The "tpl" notation type is also supported.
The motivation for this change is that Markdown tables are generally better rendered by websites like Hugo than HTML tables, but single-line snippets often make the "Default" column too wide and the overall table layout becomes unbalanced.