aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-10-11 06:29:20 +0200
committerPřemysl Eric Janouch <p@janouch.name>2021-10-11 06:32:00 +0200
commit6f569e076e3777cd3baf21ee7005b921a5918319 (patch)
tree68146b9178036ef344b7ac0d6d805e16ab3f73ca /src
parentce2b8b39c07aa04b74ed2cee397574fe1837599b (diff)
downloadtdv-6f569e076e3777cd3baf21ee7005b921a5918319.tar.gz
tdv-6f569e076e3777cd3baf21ee7005b921a5918319.tar.xz
tdv-6f569e076e3777cd3baf21ee7005b921a5918319.zip
sdtui: further improve the XML mangler
Comments should be more or less reliably handled by GMarkup now.
Diffstat (limited to 'src')
-rw-r--r--src/sdtui.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sdtui.c b/src/sdtui.c
index efdcd2b..3e74eeb 100644
--- a/src/sdtui.c
+++ b/src/sdtui.c
@@ -353,8 +353,10 @@ view_entry_split_add_xdxf (ViewEntry *ve, const gchar *xml)
GString *filtered = g_string_new ("");
while (*xml)
{
+ // GMarkup can read some of the wilder XML constructs, Pango skips them
const gchar *p = NULL;
- if (*xml != '<' || !*(p = xml + 1 + (xml[1] == '/'))
+ if (*xml != '<' || xml[1] == '!' || xml[1] == '?'
+ || g_ascii_isspace (xml[1]) || !*(p = xml + 1 + (xml[1] == '/'))
|| (strchr ("biu", *p) && p[1] == '>') || !(p = strchr (p, '>')))
g_string_append_c (filtered, *xml++);
else if (xml[1] != 'k' || xml[2] != '>' || !(xml = strstr (p, "</k>")))