span += " " + extra_attribute;
}
span += ">";
+
+ boost::algorithm::replace_all(text, "&", "&");
+ boost::algorithm::replace_all(text, "<", "<");
+ boost::algorithm::replace_all(text, ">", ">");
+
span += text;
span += "</span>";
return span;
}
-static
-string
-escape_text (string text)
-{
- /* 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.)
- */
- boost::algorithm::replace_all(text, "&", "&");
- boost::algorithm::replace_all(text, "<", "<");
- boost::algorithm::replace_all(text, ">", ">");
- return text;
-}
-
-
static
void
set_forced_appearance(shared_ptr<const TextContent> content, StringText& subtitle)
content()->get_font(subtitle.font().get_value_or("")),
valign_standard
);
- string_text.set_text(escape_text(string_text.text()));
+ string_text.set_text(string_text.text());
set_forced_appearance(content(), string_text);
string_texts.push_back(string_text);
}
v_align,
0,
dcp::Direction::LTR,
- escape_text(block.text),
+ block.text,
dcp::Effect::NONE,
block.effect_colour.get_value_or(sub::Colour(0, 0, 0)).dcp(),
/* Hack: we should use subtitle.fade_up and subtitle.fade_down here
stored = optional<ContentStringText> ();
while (!decoder->pass()) {
if (stored && stored->from() == ContentTime(0)) {
- BOOST_CHECK_EQUAL (stored->subs.front().text(), "<b>Hello world!</b>");
+ /* Text passed around by the player should be unescaped */
+ BOOST_CHECK_EQUAL(stored->subs.front().text(), "<b>Hello world!</b>");
}
}
}