From: Mathieu Baudier Date: Tue, 26 Jan 2021 09:02:04 +0000 (+0100) Subject: Temporary fix to prevent XML forbidden characters crashing the UI. X-Git-Tag: argeo-suite-2.1.18~19 X-Git-Url: https://git.argeo.org/?p=gpl%2Fargeo-suite.git;a=commitdiff_plain;h=810dab5ea22a48555058d4612ff10f8b8ecbdf08 Temporary fix to prevent XML forbidden characters crashing the UI. --- diff --git a/publishing/org.argeo.publishing.ui/src/org/argeo/docbook/ui/DbkTextInterpreter.java b/publishing/org.argeo.publishing.ui/src/org/argeo/docbook/ui/DbkTextInterpreter.java index 2717a38..eafddd9 100644 --- a/publishing/org.argeo.publishing.ui/src/org/argeo/docbook/ui/DbkTextInterpreter.java +++ b/publishing/org.argeo.publishing.ui/src/org/argeo/docbook/ui/DbkTextInterpreter.java @@ -88,6 +88,22 @@ public class DbkTextInterpreter implements TextInterpreter { public String readSimpleHtml(Item item) { String raw = raw(item); + // FIXME the saved data should be corrected instead. + if (raw.indexOf('&') >= 0) { + raw = raw.replace("&", "&"); + } + if (raw.indexOf('<') >= 0) { + raw = raw.replace("<", "<"); + } + if (raw.indexOf('>') >= 0) { + raw = raw.replace(">", ">"); + } + if (raw.indexOf('\"') >= 0) { + raw = raw.replace("\"", """); + } + if (raw.indexOf('\'') >= 0) { + raw = raw.replace("\'", "'"); + } // raw = "" + raw + ""; if (raw.length() == 0) return raw;