/* Between 1-65535 inclusive, apparently... */
out += "alpha=\"" + dcp::raw_convert<string>(int(floor(fade_factor * 65534)) + 1) + "\" ";
out += "color=\"#" + i.colour().to_rgb_string() + "\">";
-
- string t = i.text();
- replace_all(t, "&", "&");
- out += t;
-
+ out += i.text();
out += "</span>";
}
TextDecoder::emit_plain_start (ContentTime from, list<dcp::SubtitleString> s)
{
for (auto& i: s) {
- /* We must escape < and > in strings, otherwise they might confuse our subtitle
- renderer (which uses some HTML-esque markup to do bold/italic etc.)
+ /* We must escape some things, otherwise they might confuse our subtitle
+ renderer (which uses entities and some HTML-esque markup to do bold/italic etc.)
*/
string t = i.text ();
+ boost::algorithm::replace_all (t, "&", "&");
boost::algorithm::replace_all (t, "<", "<");
boost::algorithm::replace_all (t, ">", ">");
i.set_text (t);