Fix non-htmlLabel text replacement so markdown styling remains

This commit is contained in:
yari-dewalt
2025-01-24 09:40:00 -08:00
parent 02f661a103
commit 38ca14da43

View File

@@ -199,7 +199,9 @@ async function addText<T extends SVGGraphicsElement>(
if (!useHtmlLabels) {
const textChild = text.children[0];
textChild.textContent = inputText.replaceAll('&gt;', '>').replaceAll('&lt;', '<').trim();
for (const child of textChild.children) {
child.textContent = child.textContent.replaceAll('&gt;', '>').replaceAll('&lt;', '<');
}
// Get the bounding box after the text update
bbox = text.getBBox();
// Add extra height so it is similar to the html labels