diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/subtitle_asset.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/subtitle_asset.cc b/src/subtitle_asset.cc index de6332e6..bd8bb993 100644 --- a/src/subtitle_asset.cc +++ b/src/subtitle_asset.cc @@ -803,6 +803,8 @@ SubtitleAsset::fix_empty_font_ids () } +namespace { + struct State { int indent; @@ -810,13 +812,19 @@ struct State int disable_formatting; }; +} + static void format_xml_node (xmlpp::Node const* node, State& state) { if (auto text_node = dynamic_cast<const xmlpp::TextNode*>(node)) { - state.xml += text_node->get_content(); + string content = text_node->get_content(); + boost::replace_all(content, "&", "&"); + boost::replace_all(content, "<", "<"); + boost::replace_all(content, ">", ">"); + state.xml += content; } else if (auto element = dynamic_cast<const xmlpp::Element*>(node)) { ++state.indent; |
