Cleanup string escaping in XmlWriter with raw string literals

This commit is contained in:
Martin Hořeňovský 2021-05-29 14:11:50 +02:00
parent 9f091cbe9d
commit 0221148ac3
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A

View File

@ -302,7 +302,7 @@ namespace {
} }
void XmlWriter::writeStylesheetRef( std::string const& url ) { void XmlWriter::writeStylesheetRef( std::string const& url ) {
m_os << "<?xml-stylesheet type=\"text/xsl\" href=\"" << url << "\"?>\n"; m_os << R"(<?xml-stylesheet type="text/xsl" href=")" << url << R"("?>)" << '\n';
} }
XmlWriter& XmlWriter::writeBlankLine() { XmlWriter& XmlWriter::writeBlankLine() {
@ -324,7 +324,7 @@ namespace {
} }
void XmlWriter::writeDeclaration() { void XmlWriter::writeDeclaration() {
m_os << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; m_os << R"(<?xml version="1.0" encoding="UTF-8"?>)" << '\n';
} }
void XmlWriter::newlineIfNecessary() { void XmlWriter::newlineIfNecessary() {