/**@license
 *       __ _____                     ________                              __
 *      / // _  /__ __ _____ ___ __ _/__  ___/__ ___ ______ __ __  __ ___  / /
 *  __ / // // // // // _  // _// // / / // _  // _//     // //  \/ // _ \/ /
 * /  / // // // // // ___// / / // / / // ___// / / / / // // /\  // // / /__
 * \___//____ \\___//____//_/ _\_  / /_//____//_/ /_/ /_//_//_/ /_/ \__\_\___/
 *           \/              /____/
 * http://terminal.jcubic.pl
 *
 * this is utility that monkey patch Prism functions to output
 * terminal formatting (it was first created here https://codepen.io/jcubic/pen/zEyxjJ)
 *
 * usage:
 *
 *     you need to include both css and js (it need to be before this file)
 *
 * js code:
 *
 *     var grammar = Prism.languages[language];
 *     var tokens = Prism.tokenize(file, grammar);
 *     var code = Prism.Token.stringify(tokens, language);
 *
 *     term.echo(code); // or term.less(code) if you include less.js
 *
 * Copyright (c) 2018 Jakub Jankiewicz <http://jcubic.pl/me>
 * Released under the MIT license
 *
 */
/* global jQuery, Prism */
(function(Token, $) {
    var _ = Prism;
    _.Token = function(type, content, alias, matchedStr, greedy) {
        Token.apply(this, [].slice.call(arguments));
    };
    _.Token.stringify = function(o, language, parent) {
        if (typeof o == 'string') {
            return o;
        }

        if (_.util.type(o) === 'Array') {
            return o.map(function(element) {
                return _.Token.stringify(element, language, o);
            }).join('');
        }

        var env = {
            type: o.type,
            content: Token.stringify(o.content, language, parent),
            tag: 'span',
            classes: ['token', o.type],
            attributes: {},
            language: language,
            parent: parent
        };

        if (env.type == 'comment') {
            env.attributes['spellcheck'] = 'true';
        }

        if (o.alias) {
            var aliases = _.util.type(o.alias) === 'Array' ? o.alias : [o.alias];
            Array.prototype.push.apply(env.classes, aliases);
        }

        _.hooks.run('wrap', env);

        var attributes = Object.keys(env.attributes).map(function(name) {
            return name + '="' + (env.attributes[name] || '').replace(/"/g, '&quot;') + '"';
        }).join(' ');
        return env.content.split(/\n/).map(function(content) {
            return '[[b;;;' + env.classes.join(' ') + ']' + $.terminal.escape_brackets(content) + ']';
        }).join('\n');

    };
})(Prism.Token, jQuery);

@@ -1637,16 +1637,18 @@
 ontent: 
+_.
 Token.st
@@ -2165,197 +2165,8 @@
 );%0A%0A
-        var attributes = Object.keys(env.attributes).map(function(name) %7B%0A            return name + '=%22' + (env.attributes%5Bname%5D %7C%7C '').replace(/%22/g, '&quot;') + '%22';%0A        %7D).join(' ');%0A
     
@@ -2288,43 +2288,15 @@
 ' + 
-$.terminal.escape_brackets(
 content
-)
  + '

fix prism monkey patch for markup code