Use .text() don't use .html() to render preview values.

git-svn-id: http://google-refine.googlecode.com/svn/trunk@186 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
David Huynh 2010-03-04 02:04:56 +00:00
parent 9ca456411c
commit 7eaf4b098c

View File

@ -289,13 +289,13 @@ ExpressionPreviewDialog.Widget.prototype._renderPreview = function(expression, d
var renderValue = function(td, v) { var renderValue = function(td, v) {
if (v !== null && v !== undefined) { if (v !== null && v !== undefined) {
if ($.isArray(v)) { if ($.isArray(v)) {
td.html(JSON.stringify(v)); td.text(JSON.stringify(v));
} else if ($.isPlainObject(v)) { } else if ($.isPlainObject(v)) {
$('<span></span>').addClass("expression-preview-special-value").text("Error: " + v.message).appendTo(td); $('<span></span>').addClass("expression-preview-special-value").text("Error: " + v.message).appendTo(td);
} else if (typeof v === "string" && v.length == 0) { } else if (typeof v === "string" && v.length == 0) {
$('<span>empty string</span>').addClass("expression-preview-special-value").appendTo(td); $('<span>empty string</span>').addClass("expression-preview-special-value").appendTo(td);
} else { } else {
td.html(v.toString()); td.text(v.toString());
} }
} else { } else {
$('<span>null</span>').addClass("expression-preview-special-value").appendTo(td); $('<span>null</span>').addClass("expression-preview-special-value").appendTo(td);