aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-10-11 01:57:38 +0200
committerPřemysl Eric Janouch <p@janouch.name>2021-10-11 02:43:34 +0200
commite57751fe0e56d8ee4de6b1d301ecd1b41648839d (patch)
tree8776e0ebd373dbcb152a6ef9773f54f78fdcdbb7
parent4d6cd247cb226eff6c302748474534c23459cbec (diff)
downloadtdv-e57751fe0e56d8ee4de6b1d301ecd1b41648839d.tar.gz
tdv-e57751fe0e56d8ee4de6b1d301ecd1b41648839d.tar.xz
tdv-e57751fe0e56d8ee4de6b1d301ecd1b41648839d.zip
sdtui: skip keywords in XDXF
-rw-r--r--src/sdtui.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/sdtui.c b/src/sdtui.c
index 04d7ddb..efdcd2b 100644
--- a/src/sdtui.c
+++ b/src/sdtui.c
@@ -349,6 +349,7 @@ view_entry_split_add_xdxf (ViewEntry *ve, const gchar *xml)
{
// Trivially filter out all tags we can't quite handle,
// then parse the reduced XML as Pango markup--this seems to work well.
+ // Given the nature of our display, also skip keyword elements.
GString *filtered = g_string_new ("");
while (*xml)
{
@@ -356,7 +357,7 @@ view_entry_split_add_xdxf (ViewEntry *ve, const gchar *xml)
if (*xml != '<' || !*(p = xml + 1 + (xml[1] == '/'))
|| (strchr ("biu", *p) && p[1] == '>') || !(p = strchr (p, '>')))
g_string_append_c (filtered, *xml++);
- else
+ else if (xml[1] != 'k' || xml[2] != '>' || !(xml = strstr (p, "</k>")))
xml = ++p;
}
view_entry_split_add_pango (ve, filtered->str);