Allow Collators to have their language specified, and specify it for tests.
[dcpomatic.git] / src / lib / render_text.cc
index d3db4ac1940c245987d16c4f055e632d82f2cec7..702f848ac261d5d6730e319c72850313ec6aae4d 100644 (file)
@@ -25,7 +25,6 @@
 #include "font_config.h"
 #include "image.h"
 #include "render_text.h"
-#include "types.h"
 #include "util.h"
 #include <dcp/raw_convert.h>
 #include <dcp/warnings.h>
@@ -103,6 +102,11 @@ marked_up (list<StringText> subtitles, int target_height, float fade_factor, str
                        span += " " + extra_attribute;
                }
                span += ">";
+
+               boost::algorithm::replace_all(text, "&", "&amp;");
+               boost::algorithm::replace_all(text, "<", "&lt;");
+               boost::algorithm::replace_all(text, ">", "&gt;");
+
                span += text;
                span += "</span>";
                return span;