forked from qt-creator/qt-creator
QmlConsole: Remove zero width space
Zero width space is inserted at every punctuation to serve as a potential line break. All occurrences should be removed before sending the expression to JS engine for evaluation. Task-number: QTCREATORBUG-8859 Change-Id: I170dfd5fb0f1122ed945bb2e5f77ecaad925004b Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
committed by
Kai Koehne
parent
f57795aaf2
commit
7bba366482
@@ -149,4 +149,10 @@ const QString &ConsoleItem::text() const
|
||||
return m_text;
|
||||
}
|
||||
|
||||
QString ConsoleItem::expression() const
|
||||
{
|
||||
QString text = m_text;
|
||||
return text.remove(QChar(0x200b)); // ZERO WIDTH SPACE
|
||||
}
|
||||
|
||||
} // QmlJS
|
||||
|
||||
@@ -67,6 +67,7 @@ public:
|
||||
int childNumber() const;
|
||||
void setText(const QString &text);
|
||||
const QString &text() const;
|
||||
QString expression() const;
|
||||
|
||||
private:
|
||||
ConsoleItem *m_parentItem;
|
||||
|
||||
Reference in New Issue
Block a user