[TD]Fix mishandling of escaped html in Templates
This commit is contained in:
@@ -29,6 +29,8 @@
|
||||
#include <QTextDocument>
|
||||
#endif // #ifndef _PreCmp_
|
||||
|
||||
#include <Base/Console.h>
|
||||
|
||||
#include "DlgTemplateField.h"
|
||||
#include "TemplateTextField.h"
|
||||
|
||||
@@ -64,11 +66,15 @@ void TemplateTextField::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
ui.setFieldContent(tmplte->EditableTexts[fieldNameStr]);
|
||||
|
||||
if (ui.exec() == QDialog::Accepted) {
|
||||
#if QT_VERSION >= 0x050000
|
||||
QString qsClean = ui.getFieldContent().toHtmlEscaped();
|
||||
#else
|
||||
QString qsClean = Qt::escape( ui.getFieldContent() );
|
||||
#endif
|
||||
//WF: why is this escaped?
|
||||
// "<" is converted elsewhere and no other characters cause problems.
|
||||
// escaping causes "&" to appear as "&" etc
|
||||
//#if QT_VERSION >= 0x050000
|
||||
// QString qsClean = ui.getFieldContent().toHtmlEscaped();
|
||||
//#else
|
||||
// QString qsClean = Qt::escape( ui.getFieldContent() );
|
||||
//#endif
|
||||
QString qsClean = ui.getFieldContent();
|
||||
std::string utf8Content = qsClean.toUtf8().constData();
|
||||
tmplte->EditableTexts.setValue(fieldNameStr, utf8Content);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user