diff --git a/source/engine/core/core.js b/source/engine/core/core.js index e114bcf..13076a3 100644 --- a/source/engine/core/core.js +++ b/source/engine/core/core.js @@ -27,3 +27,8 @@ export function IsObjectEmpty (obj) { return Object.keys (obj).length === 0; } + +export function EscapeHtmlChars (str) +{ + return str.replaceAll ('<', '<').replaceAll ('>', '>'); +} diff --git a/source/engine/main.js b/source/engine/main.js index 4edf9cb..d5639f7 100644 --- a/source/engine/main.js +++ b/source/engine/main.js @@ -1,4 +1,4 @@ -import { IsDefined, ValueOrDefault, CopyObjectAttributes, IsObjectEmpty } from './core/core.js'; +import { IsDefined, ValueOrDefault, CopyObjectAttributes, IsObjectEmpty, EscapeHtmlChars } from './core/core.js'; import { TaskRunner, RunTaskAsync, RunTasks, RunTasksBatch, WaitWhile } from './core/taskrunner.js'; import { Exporter } from './export/exporter.js'; import { Exporter3dm } from './export/exporter3dm.js'; @@ -75,6 +75,7 @@ export { ValueOrDefault, CopyObjectAttributes, IsObjectEmpty, + EscapeHtmlChars, TaskRunner, RunTaskAsync, RunTasks, diff --git a/source/engine/model/property.js b/source/engine/model/property.js index a0aa560..8643230 100644 --- a/source/engine/model/property.js +++ b/source/engine/model/property.js @@ -1,3 +1,4 @@ +import { EscapeHtmlChars } from '../core/core.js'; import { ColorToHexString } from './color.js'; export const PropertyType = @@ -66,7 +67,7 @@ export class PropertyGroup export function PropertyToString (property) { if (property.type === PropertyType.Text) { - return property.value; + return EscapeHtmlChars (property.value); } else if (property.type === PropertyType.Integer) { return property.value.toLocaleString (); } else if (property.type === PropertyType.Number) {