diff --git a/src/main/display.cc b/src/main/display.cc
index f5cd59ffd..b888f0a09 100644
--- a/src/main/display.cc
+++ b/src/main/display.cc
@@ -1610,13 +1610,16 @@ GTKChapDisp::display(SWModule &imodule)
// insert the userfootnote reference
if (e) {
+ gchar *escaped_value = g_uri_escape_string(
+ e->annotation->str, NULL, TRUE);
buf = g_strdup_printf(""
""
"*u ",
settings.MainWindowModule,
(char *)key->getShortText(),
- e->annotation->str);
+ escaped_value);
+ g_free(escaped_value);
swbuf.append(buf);
g_free(buf);
}
@@ -2048,13 +2051,16 @@ DialogChapDisp::display(SWModule &imodule)
// insert the userfootnote reference
if (e) {
+ gchar *escaped_value = g_uri_escape_string(
+ e->annotation->str, NULL, TRUE);
buf = g_strdup_printf(""
""
"*u ",
/*xxx*/ settings.MainWindowModule,
(char *)key->getShortText(),
- e->annotation->str);
+ escaped_value);
+ g_free(escaped_value);
swbuf.append(buf);
g_free(buf);
}