[TD]"<" symbol embedded in html
This commit is contained in:
@@ -158,10 +158,19 @@ void QGIViewAnnotation::drawAnnotation()
|
||||
if (it != annoText.begin()) {
|
||||
ss << "<br>";
|
||||
}
|
||||
std::string u8String = Base::Tools::escapedUnicodeToUtf8(*it);
|
||||
// what madness turns \' into \\\\\'?
|
||||
std::string apos = std::regex_replace((u8String), std::regex("\\\\\'"), "'");
|
||||
ss << apos;
|
||||
//TODO: there is still a bug here. entering "'" works, save and restore works, but edit after
|
||||
// save and restore brings "\'" back into text. manually deleting the "\" fixes it until the next
|
||||
// save/restore/edit cycle.
|
||||
// a guess is that the editor for propertyStringList is too enthusiastic about substituting.
|
||||
// the substituting might be necessary for using the strings in Python.
|
||||
// ' doesn't seem to help in this case.
|
||||
|
||||
std::string u8String = Base::Tools::escapedUnicodeToUtf8(*it); //from \x??\x?? to real utf8
|
||||
std::string apos = std::regex_replace((u8String), std::regex("\\\\"), ""); //remove doubles.
|
||||
apos = std::regex_replace((apos), std::regex("\\'"), "'"); //replace escaped apos
|
||||
//"less than" symbol chops off line. need to use html sub.
|
||||
std::string lt = std::regex_replace((apos), std::regex("<"), "<");
|
||||
ss << lt;
|
||||
}
|
||||
ss << "<br></p>\n</body>\n</html> ";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user