lib/json-format.js
function (value) {
        var valueType = typeof value;

        var output = "";
        if (value === null || value === undefined) {
            output += this.decorateWithSpan('null', 'null');
        }
        else if (value && value.constructor === Array) {
            output += this.arrayToHTML(value);
        }
        else if (valueType === 'object') {
            output += this.objectToHTML(value);
        }
        else if (valueType === 'number') {
            output += this.decorateWithSpan(value, 'num');
        }
        else if (valueType === 'string') {
            if (/^(http|https):\/\/[^\s]+$/.test(value)) {
                output += '<a href="' + value + '">' +
                    this.htmlEncode(value) + '</a>';
            } else {
                output += this.decorateWithSpan('"' + value + '"', 'string');
            }
        }
        else if (valueType === 'boolean') {
            output += this.decorateWithSpan(value, 'bool');
        }

        return output;
    }
function (value) {
        var valueType = typeof value;

        var output = "";
        if (value === null || value === undefined) {
            output += this.decorateWithSpan('null', 'null');
        }
        else if (value && value.constructor === Array) {
            output += this.arrayToHTML(value);
        }
        else if (valueType === 'object') {
            output += this.objectToHTML(value);
        }
        else if (valueType === 'number') {
            output += this.decorateWithSpan(value, 'num');
        }
        else if (valueType === 'string') {
            if (/^(http|https):\/\/[^\s]+$/.test(value)) {
                output += '<a href="' + value + '">' +
                    this.htmlEncode(value) + '</a>';
            } else {
                output += this.decorateWithSpan('"' + value + '"', 'string');
            }
        }
        else if (valueType === 'boolean') {
            output += this.decorateWithSpan(value, 'bool');
        }

        return output;
    }
Convert a basic JSON datatype (number, string, boolean, null, object, array) into an HTML fragment.