fix: escape html (#27469)

This commit is contained in:
Jason Rasmussen 2026-04-02 15:19:24 -04:00 committed by GitHub
parent 37823bcd51
commit c8ae99e7d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,6 +19,7 @@
import { ResolutionPlugin } from '@photo-sphere-viewer/resolution-plugin';
import { SettingsPlugin } from '@photo-sphere-viewer/settings-plugin';
import '@photo-sphere-viewer/settings-plugin/index.css';
import { escape } from 'lodash-es';
import { onDestroy, onMount } from 'svelte';
// Adapted as well as possible from classlist 'border-solid border-white border-3 rounded-lg'
@ -138,7 +139,7 @@
const fontSize = (1.4 * width) / box.text.length; // fits almost all strings within the box, depends on font family
const transform = `matrix3d(${matrix.join(',')})`;
const content = `<div class="${OCR_TOOLTIP_HTML_CLASS}" style="font-size: ${fontSize}px; width: ${width}px; height: ${height}px; transform: ${transform}; transform-origin: 0 0;">${box.text}</div>`;
const content = `<div class="${OCR_TOOLTIP_HTML_CLASS}" style="font-size: ${fontSize}px; width: ${width}px; height: ${height}px; transform: ${transform}; transform-origin: 0 0;">${escape(box.text)}</div>`;
if (updateOnly) {
markersPlugin.updateMarker({