From f58770712d6837542219e26cfe0a55241d691f49 Mon Sep 17 00:00:00 2001
From: Leandro Melo <leandro.melo@nokia.com>
Date: Mon, 11 Oct 2010 12:38:37 +0200
Subject: [PATCH] Snippets: Escape characters for the tip preview.

Reviewed-by: ckamm
---
 src/plugins/texteditor/snippetsparser.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/plugins/texteditor/snippetsparser.cpp b/src/plugins/texteditor/snippetsparser.cpp
index 7e30cd94d37..040d662dca9 100644
--- a/src/plugins/texteditor/snippetsparser.cpp
+++ b/src/plugins/texteditor/snippetsparser.cpp
@@ -36,6 +36,7 @@
 #include <QtCore/QVariant>
 #include <QtCore/QXmlStreamReader>
 #include <QtCore/QDebug>
+#include <QtGui/QTextDocument>
 
 using namespace TextEditor;
 
@@ -81,6 +82,7 @@ const QList<CompletionItem> &SnippetsParser::execute(ICompletionCollector *colle
                                     QString infotip = data;
                                     while (infotip.size() && infotip.at(infotip.size()-1).isSpace())
                                         infotip.chop(1);
+                                    infotip = Qt::escape(infotip);
                                     infotip.replace(QLatin1Char('\n'), QLatin1String("<br>"));
                                     infotip.replace(QLatin1Char(' '), QLatin1String("&nbsp;"));
                                     {
-- 
GitLab