Commit fe23f66d authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Let server side handle search results HTML escaping.

Mike fixed the server side escaping, so we don't need this hack any more.
parent 42b28d5f
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -53,13 +53,11 @@ Ext.define("Docs.GuideSearch", {
    },

    // Extracts string from Array if needed
    // Escapes HTML (not escaped in JSON)
    // Gets rid of newlines (search results view doesn't like them)
    // Replaces supplied highlighting with our highlighting tags.
    format: function(data) {
        var s = Ext.isArray(data) ? data[0] : data;
        var s = Ext.String.htmlEncode(s).replace(/\n/g, " ");
        return s.replace(/&lt;em class=&quot;match&quot;&gt;(.*?)&lt;\/em&gt;/g, "<strong>$1</strong>");
        return s.replace(/\n/g, " ").replace(/<em class="match">(.*?)<\/em>/g, "<strong>$1</strong>");
    },

    // Removes search context before the matching text.