mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
fix: escape html (#27469)
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
import { ResolutionPlugin } from '@photo-sphere-viewer/resolution-plugin';
|
import { ResolutionPlugin } from '@photo-sphere-viewer/resolution-plugin';
|
||||||
import { SettingsPlugin } from '@photo-sphere-viewer/settings-plugin';
|
import { SettingsPlugin } from '@photo-sphere-viewer/settings-plugin';
|
||||||
import '@photo-sphere-viewer/settings-plugin/index.css';
|
import '@photo-sphere-viewer/settings-plugin/index.css';
|
||||||
|
import { escape } from 'lodash-es';
|
||||||
import { onDestroy, onMount } from 'svelte';
|
import { onDestroy, onMount } from 'svelte';
|
||||||
|
|
||||||
// Adapted as well as possible from classlist 'border-solid border-white border-3 rounded-lg'
|
// 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 fontSize = (1.4 * width) / box.text.length; // fits almost all strings within the box, depends on font family
|
||||||
const transform = `matrix3d(${matrix.join(',')})`;
|
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) {
|
if (updateOnly) {
|
||||||
markersPlugin.updateMarker({
|
markersPlugin.updateMarker({
|
||||||
|
|||||||
Reference in New Issue
Block a user