Skip to content
Snippets Groups Projects
Commit f5877071 authored by Leandro Melo's avatar Leandro Melo
Browse files

Snippets: Escape characters for the tip preview.

Reviewed-by: ckamm
parent 40bbd05b
No related branches found
No related tags found
No related merge requests found
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <QtCore/QVariant> #include <QtCore/QVariant>
#include <QtCore/QXmlStreamReader> #include <QtCore/QXmlStreamReader>
#include <QtCore/QDebug> #include <QtCore/QDebug>
#include <QtGui/QTextDocument>
using namespace TextEditor; using namespace TextEditor;
...@@ -81,6 +82,7 @@ const QList<CompletionItem> &SnippetsParser::execute(ICompletionCollector *colle ...@@ -81,6 +82,7 @@ const QList<CompletionItem> &SnippetsParser::execute(ICompletionCollector *colle
QString infotip = data; QString infotip = data;
while (infotip.size() && infotip.at(infotip.size()-1).isSpace()) while (infotip.size() && infotip.at(infotip.size()-1).isSpace())
infotip.chop(1); infotip.chop(1);
infotip = Qt::escape(infotip);
infotip.replace(QLatin1Char('\n'), QLatin1String("<br>")); infotip.replace(QLatin1Char('\n'), QLatin1String("<br>"));
infotip.replace(QLatin1Char(' '), QLatin1String("&nbsp;")); infotip.replace(QLatin1Char(' '), QLatin1String("&nbsp;"));
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment