Skip to content

Commit 415d4b5

Browse files
committed
Fix markdown tooltips treating Rust type labels as HTML tags
Closes #3520, a regression introduced in #3488.
1 parent 11e2882 commit 415d4b5

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

frontend/src/components/floating-menus/ColorPicker.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,7 @@
566566
min={0}
567567
max={255}
568568
minWidth={1}
569+
displayDecimalPlaces={0}
569570
tooltipLabel={{ r: "Red Channel", g: "Green Channel", b: "Blue Channel" }[channel]}
570571
tooltipDescription="Integers 0–255."
571572
/>

frontend/src/components/floating-menus/Tooltip.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@
3636
function parseMarkdown(markdown: string | undefined): string | undefined {
3737
if (!markdown) return undefined;
3838
39+
let text = markdown.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;");
40+
3941
return (
40-
markdown
42+
text
4143
// .split("\n")
4244
// .map((line) => line.trim())
4345
// .join("\n")

0 commit comments

Comments
 (0)