Repository navigation
Conversation
…led by default Raw HTML in Markdown panels is now escaped and displayed as plain text unless the new enableHtml option is set, so placeholders such as <host>:<port> are no longer stripped by the sanitizer. DOMPurify is kept as a second layer in both modes. Grafana text panels in html mode are migrated with enableHtml: true. The option is available in the panel editor, the CUE schema, the Go SDK (EnableHTML) and the docs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
Align the option name with perses/perses#4684. The Go SDK option is renamed from EnableHTML to RenderHTML. HTML rendering stays disabled by default, and Grafana text panels in html mode are still migrated with renderHtml: true. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
Gladorme
marked this pull request as ready for review
October 30, 2026 16:24
Gladorme
requested review from
a team,
AntoineThebaud and
Nexucis
as code owners
October 30, 2026 16:24
jgbernalp
reviewed
Nov 2, 2026
| const markdownWithoutHTML = new Marked({ | ||
| gfm: true, | ||
| renderer: { | ||
| html: ({ text }): string => escapeHTML(text), |
Contributor
There was a problem hiding this comment.
overriding the html renderer might not be enough to scape actual HTML. For example passing:
prefix <code><img/src=//example.com/tracker></code>
would still load an image.
We might need something like:
const markdownWithoutHTML = new Marked({
gfm: true,
tokenizer: {
html(): undefined {
return undefined;
},
tag(): undefined {
return undefined;
},
},
});
Contributor
|
Is this a breaking change? it seems the renderHTML in the schema is optional, so this should be backwards compatible |
Member
Author
I would like to have the same behavior of perses/shared#380. I find Markdown content different between two components is strange 👀 |
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.
Description
Close issue: perses/perses#4684
Raw HTML in Markdown panels is now escaped and displayed as plain text unless the new enableHtml option is set, so placeholders such as : are no longer stripped by the sanitizer. DOMPurify is kept as a second layer in both modes. Grafana text panels in html mode are migrated with enableHtml: true. The option is available in the panel editor, the CUE schema, the Go SDK (RenderHTML) and the docs. Aligning with panel description (perses/shared#380).
Breaking change
Raw HTML render is disabled by default, if necessary you can re-enable it with
renderHtml: trueScreenshots
Render disabled:

Render enabled:

Checklist
[<catalog_entry>] <commit message>naming convention using one of thefollowing
catalog_entryvalues:FEATURE,ENHANCEMENT,BUGFIX,BREAKINGCHANGE,DOC,IGNORE.UI Changes