[gnome-subtitles] Fix #128: Video not showing text with ampersand



commit f13de18ae18681679a9ade1a341fb68dbd6d01bd
Author: Pedro Castro <pedro gnomesubtitles org>
Date:   Sat May 18 08:52:34 2019 +0100

    Fix #128: Video not showing text with ampersand
    
    Video was not showing subtitles with the ampersand (&) character,
    as well as other XML entities used in Pango Markup, because they
    weren't being escaped.

 src/GnomeSubtitles/Ui/VideoPreview/SubtitleOverlay.cs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/GnomeSubtitles/Ui/VideoPreview/SubtitleOverlay.cs 
b/src/GnomeSubtitles/Ui/VideoPreview/SubtitleOverlay.cs
index 5146b67..8732056 100644
--- a/src/GnomeSubtitles/Ui/VideoPreview/SubtitleOverlay.cs
+++ b/src/GnomeSubtitles/Ui/VideoPreview/SubtitleOverlay.cs
@@ -1,6 +1,6 @@
 /*
  * This file is part of Gnome Subtitles.
- * Copyright (C) 2007-2017 Pedro Castro
+ * Copyright (C) 2007-2019 Pedro Castro
  *
  * Gnome Subtitles is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -21,7 +21,6 @@ using Gdk;
 using GnomeSubtitles.Core;
 using Gtk;
 using SubLib.Core.Domain;
-using SubLib.Core.Search;
 using System;
 using System.Runtime.InteropServices;
 
@@ -127,7 +126,8 @@ public class SubtitleOverlay {
                if (subtitle.Style.Underline)
                        markup += " underline=\"single\"";
 
-               markup += ">" + text + "</span>";
+               markup += ">" + GLib.Markup.EscapeText(text) + "</span>";
+               
                label.Markup = markup;
                label.Visible = true;
        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]