{ target: DOMElement, params: Object } objects.
*/
findElements: function findElements(globalParams, element) {
var elements = element ? [element] : utils.toArray(document.getElementsByTagName(sh.config.tagName)),
conf = sh.config,
result = [];
// support for feature
elements = elements.concat(dom.getSyntaxHighlighterScriptTags());
if (elements.length === 0) return result;
for (var i = 0, l = elements.length; i < l; i++) {
var item = {
target: elements[i],
// local params take precedence over globals
params: optsParser.defaults(optsParser.parse(elements[i].className), globalParams)
};
if (item.params['brush'] == null) continue;
result.push(item);
}
return result;
},
/**
* Shorthand to highlight all elements on the page that are marked as
* SyntaxHighlighter source code.
*
* @param {Object} globalParams Optional parameters which override element's
* parameters. Only used if element is specified.
*
* @param {Object} element Optional element to highlight. If none is
* provided, all elements in the current document
* are highlighted.
*/
highlight: function highlight(globalParams, element) {
var elements = sh.findElements(globalParams, element),
propertyName = 'innerHTML',
brush = null,
renderer,
conf = sh.config;
if (elements.length === 0) return;
for (var i = 0, l = elements.length; i < l; i++) {
var element = elements[i],
target = element.target,
params = element.params,
brushName = params.brush,
brush,
matches,
code;
if (brushName == null) continue;
brush = findBrush(brushName);
if (!brush) continue;
// local params take precedence over defaults
params = optsParser.defaults(params || {}, defaults);
params = optsParser.defaults(params, config);
// Instantiate a brush
if (params['html-script'] == true || defaults['html-script'] == true) {
brush = new HtmlScript(findBrush('xml'), brush);
brushName = 'htmlscript';
} else {
brush = new brush();
}
code = target[propertyName];
// remove CDATA from tags if it's present
if (conf.useScriptTags) code = stripCData(code);
// Inject title if the attribute is present
if ((target.title || '') != '') params.title = target.title;
params['brush'] = brushName;
code = transformers(code, params);
matches = match.applyRegexList(code, brush.regexList, params);
renderer = new Renderer(code, matches, params);
element = dom.create('div');
element.innerHTML = renderer.getHtml();
// id = utils.guid();
// element.id = highlighters.id(id);
// highlighters.set(id, element);
if (params.quickCode) dom.attachEvent(dom.findElement(element, '.code'), 'dblclick', dom.quickCodeHandler);
// carry over ID
if ((target.id || '') != '') element.id = target.id;
target.parentNode.replaceChild(element, target);
}
}
}; // end of sh
/**
* Displays an alert.
* @param {String} str String to display.
*/
function alert(str) {
window.alert('SyntaxHighlighter\n\n' + str);
};
/**
* Finds a brush by its alias.
*
* @param {String} alias Brush alias.
* @param {Boolean} showAlert Suppresses the alert if false.
* @return {Brush} Returns bursh constructor if found, null otherwise.
*/
function findBrush(alias, showAlert) {
var brushes = sh.vars.discoveredBrushes,
result = null;
if (brushes == null) {
brushes = {};
// Find all brushes
for (var brushName in sh.brushes) {
var brush = sh.brushes[brushName],
aliases = brush.aliases;
if (aliases == null) {
continue;
}
brush.className = brush.className || brush.aliases[0];
brush.brushName = brush.className || brushName.toLowerCase();
for (var i = 0, l = aliases.length; i < l; i++) {
brushes[aliases[i]] = brushName;
}
}
sh.vars.discoveredBrushes = brushes;
}
result = sh.brushes[brushes[alias]];
if (result == null && showAlert) alert(sh.config.strings.noBrush + alias);
return result;
};
/**
* Strips from content because it should be used
* there in most cases for XHTML compliance.
* @param {String} original Input code.
* @return {String} Returns code without leading tags.
*/
function stripCData(original) {
var left = '',
// for some reason IE inserts some leading blanks here
copy = utils.trim(original),
changed = false,
leftLength = left.length,
rightLength = right.length;
if (copy.indexOf(left) == 0) {
copy = copy.substring(leftLength);
changed = true;
}
var copyLength = copy.length;
if (copy.indexOf(right) == copyLength - rightLength) {
copy = copy.substring(0, copyLength - rightLength);
changed = true;
}
return changed ? copy : original;
};
var brushCounter = 0;
exports.default = sh;
var registerBrush = exports.registerBrush = function registerBrush(brush) {
return sh.brushes['brush' + brushCounter++] = brush.default || brush;
};
var clearRegisteredBrushes = exports.clearRegisteredBrushes = function clearRegisteredBrushes() {
sh.brushes = {};
brushCounter = 0;
};
/* an EJS hook for `gulp build --brushes` command
* */
registerBrush(__webpack_require__(23));
registerBrush(__webpack_require__(24));
registerBrush(__webpack_require__(25));
registerBrush(__webpack_require__(26));
registerBrush(__webpack_require__(27));
registerBrush(__webpack_require__(28));
registerBrush(__webpack_require__(29));
registerBrush(__webpack_require__(30));
registerBrush(__webpack_require__(31));
/*
*/
/***/ },
/* 2 */
/***/ function(module, exports, __webpack_require__) {
var XRegExp = __webpack_require__(3).XRegExp;
var BOOLEANS = { 'true': true, 'false': false };
function camelize(key) {
return key.replace(/-(\w+)/g, function (match, word) {
return word.charAt(0).toUpperCase() + word.substr(1);
});
}
function process(value) {
var result = BOOLEANS[value];
return result == null ? value : result;
}
module.exports = {
defaults: function defaults(target, source) {
for (var key in source || {}) {
if (!target.hasOwnProperty(key)) target[key] = target[camelize(key)] = source[key];
}return target;
},
parse: function parse(str) {
var match,
key,
result = {},
arrayRegex = XRegExp("^\\[(? tag with given style applied to it.
*
* @param {String} str Input string.
* @param {String} css Style name to apply to the string.
* @return {String} Returns input string with each line surrounded by tag.
*/
wrapLinesWithCode: function wrapLinesWithCode(str, css) {
if (str == null || str.length == 0 || str == '\n' || css == null) return str;
var _this = this,
results = [],
lines,
line,
spaces,
i,
l;
str = str.replace(/... to them so that leading spaces aren't included.
for (i = 0, l = lines.length; i < l; i++) {
line = lines[i];
spaces = '';
if (line.length > 0) {
line = line.replace(/^( | )+/, function (s) {
spaces = s;
return '';
});
line = line.length === 0 ? spaces : spaces + '' + line + '';
}
results.push(line);
}
return results.join('\n');
},
/**
* Turns all URLs in the code into tags.
* @param {String} code Input code.
* @return {String} Returns code with ' + spaces + '' : '') + line);
}
return html;
},
/**
* Returns HTML for the table title or empty string if title is null.
*/
getTitleHtml: function getTitleHtml(title) {
return title ? '| ' + _this.renderLineNumbers(code) + ' | ' : '') + '\n\n ' + html + ' \n | \n
findElement(container, className, true).
* @param {Element} target Target element.
* @param {String} className Class name to look for.
* @return {Element} Returns found parent element on null.
*/
function findParentElement(target, className) {
return findElement(target, className, true);
}
/**
* Opens up a centered popup window.
* @param {String} url URL to open in the window.
* @param {String} name Popup name.
* @param {int} width Popup width.
* @param {int} height Popup height.
* @param {String} options window.open() options.
* @return {Window} Returns window instance.
*/
function popup(url, name, width, height, options) {
var x = (screen.width - width) / 2,
y = (screen.height - height) / 2;
options += ', left=' + x + ', top=' + y + ', width=' + width + ', height=' + height;
options = options.replace(/^,/, '');
var win = window.open(url, name, options);
win.focus();
return win;
}
function getElementsByTagName(name) {
return document.getElementsByTagName(name);
}
/**
* Finds all elements on the page which could be processes by SyntaxHighlighter.
*/
function findElementsToHighlight(opts) {
var elements = getElementsByTagName(opts['tagName']),
scripts,
i;
// support for feature
if (opts['useScriptTags']) {
scripts = getElementsByTagName('script');
for (i = 0; i < scripts.length; i++) {
if (scripts[i].type.match(/^(text\/)?syntaxhighlighter$/)) elements.push(scripts[i]);
}
}
return elements;
}
function create(name) {
return document.createElement(name);
}
/**
* Quick code mouse double click handler.
*/
function quickCodeHandler(e) {
var target = e.target,
highlighterDiv = findParentElement(target, '.syntaxhighlighter'),
container = findParentElement(target, '.container'),
textarea = document.createElement('textarea'),
highlighter;
if (!container || !highlighterDiv || findElement(container, 'textarea')) return;
//highlighter = highlighters.get(highlighterDiv.id);
// add source class name
addClass(highlighterDiv, 'source');
// Have to go over each line and grab it's text, can't just do it on the
// container because Firefox loses all \n where as Webkit doesn't.
var lines = container.childNodes,
code = [];
for (var i = 0, l = lines.length; i < l; i++) {
code.push(lines[i].innerText || lines[i].textContent);
} // using \r instead of \r or \r\n makes this work equally well on IE, FF and Webkit
code = code.join('\r');
// For Webkit browsers, replace nbsp with a breaking space
code = code.replace(/\u00a0/g, " ");
// inject tag
textarea.readOnly = true; // https://github.com/syntaxhighlighter/syntaxhighlighter/pull/329
textarea.appendChild(document.createTextNode(code));
container.appendChild(textarea);
// preselect all text
textarea.focus();
textarea.select();
// set up handler for lost focus
attachEvent(textarea, 'blur', function (e) {
textarea.parentNode.removeChild(textarea);
removeClass(highlighterDiv, 'source');
});
};
module.exports = {
quickCodeHandler: quickCodeHandler,
create: create,
popup: popup,
hasClass: hasClass,
addClass: addClass,
removeClass: removeClass,
attachEvent: attachEvent,
findElement: findElement,
findParentElement: findParentElement,
getSyntaxHighlighterScriptTags: getSyntaxHighlighterScriptTags,
findElementsToHighlight: findElementsToHighlight
};
/***/ },
/* 18 */
/***/ function(module, exports) {
module.exports = {
space: ' ',
/** Enables use of tags. */
useScriptTags: true,
/** Blogger mode flag. */
bloggerMode: false,
stripBrs: false,
/** Name of the tag that SyntaxHighlighter will automatically look for. */
tagName: 'pre'
};
/***/ },
/* 19 */
/***/ function(module, exports) {
module.exports = {
/** Additional CSS class names to be added to highlighter elements. */
'class-name': '',
/** First line number. */
'first-line': 1,
/**
* Pads line numbers. Possible values are:
*
* false - don't pad line numbers.
* true - automaticaly pad numbers with minimum required number of leading zeroes.
* [int] - length up to which pad line numbers.
*/
'pad-line-numbers': false,
/** Lines to highlight. */
'highlight': null,
/** Title to be displayed above the code block. */
'title': null,
/** Enables or disables smart tabs. */
'smart-tabs': true,
/** Gets or sets tab size. */
'tab-size': 4,
/** Enables or disables gutter. */
'gutter': true,
/** Enables quick code copy and paste from double click. */
'quick-code': true,
/** Forces code view to be collapsed. */
'collapse': false,
/** Enables or disables automatic links. */
'auto-links': true,
'unindent': true,
'html-script': false
};
/***/ },
/* 20 */
/***/ function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {var applyRegexList = __webpack_require__(5).applyRegexList;
function HtmlScript(BrushXML, brushClass) {
var scriptBrush,
xmlBrush = new BrushXML();
if (brushClass == null) return;
scriptBrush = new brushClass();
if (scriptBrush.htmlScript == null) throw new Error('Brush wasn\'t configured for html-script option: ' + brushClass.brushName);
xmlBrush.regexList.push({ regex: scriptBrush.htmlScript.code, func: process });
this.regexList = xmlBrush.regexList;
function offsetMatches(matches, offset) {
for (var j = 0, l = matches.length; j < l; j++) {
matches[j].index += offset;
}
}
function process(match, info) {
var code = match.code,
results = [],
regexList = scriptBrush.regexList,
offset = match.index + match.left.length,
htmlScript = scriptBrush.htmlScript,
matches;
function add(matches) {
results = results.concat(matches);
}
matches = applyRegexList(code, regexList);
offsetMatches(matches, offset);
add(matches);
// add left script bracket
if (htmlScript.left != null && match.left != null) {
matches = applyRegexList(match.left, [htmlScript.left]);
offsetMatches(matches, match.index);
add(matches);
}
// add right script bracket
if (htmlScript.right != null && match.right != null) {
matches = applyRegexList(match.right, [htmlScript.right]);
offsetMatches(matches, match.index + match[0].lastIndexOf(match.right));
add(matches);
}
for (var j = 0, l = results.length; j < l; j++) {
results[j].brushName = brushClass.brushName;
}return results;
}
};
module.exports = HtmlScript;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(21)))
/***/ },
/* 21 */
/***/ function(module, exports) {
// shim for using process in browser
var process = module.exports = {};
// cached from whatever global is present so that test runners that stub it
// don't break things. But we need to wrap it in a try catch in case it is
// wrapped in strict mode code which doesn't define any globals. It's inside a
// function because try/catches deoptimize in certain engines.
var cachedSetTimeout;
var cachedClearTimeout;
(function () {
try {
cachedSetTimeout = setTimeout;
} catch (e) {
cachedSetTimeout = function cachedSetTimeout() {
throw new Error('setTimeout is not defined');
};
}
try {
cachedClearTimeout = clearTimeout;
} catch (e) {
cachedClearTimeout = function cachedClearTimeout() {
throw new Error('clearTimeout is not defined');
};
}
})();
function runTimeout(fun) {
if (cachedSetTimeout === setTimeout) {
return setTimeout(fun, 0);
} else {
return cachedSetTimeout.call(null, fun, 0);
}
}
function runClearTimeout(marker) {
if (cachedClearTimeout === clearTimeout) {
clearTimeout(marker);
} else {
cachedClearTimeout.call(null, marker);
}
}
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
if (!draining || !currentQueue) {
return;
}
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
}
if (queue.length) {
drainQueue();
}
}
function drainQueue() {
if (draining) {
return;
}
var timeout = runTimeout(cleanUpNextTick);
draining = true;
var len = queue.length;
while (len) {
currentQueue = queue;
queue = [];
while (++queueIndex < len) {
if (currentQueue) {
currentQueue[queueIndex].run();
}
}
queueIndex = -1;
len = queue.length;
}
currentQueue = null;
draining = false;
runClearTimeout(timeout);
}
process.nextTick = function (fun) {
var args = new Array(arguments.length - 1);
if (arguments.length > 1) {
for (var i = 1; i < arguments.length; i++) {
args[i - 1] = arguments[i];
}
}
queue.push(new Item(fun, args));
if (queue.length === 1 && !draining) {
runTimeout(drainQueue);
}
};
// v8 likes predictible objects
function Item(fun, array) {
this.fun = fun;
this.array = array;
}
Item.prototype.run = function () {
this.fun.apply(null, this.array);
};
process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
process.version = ''; // empty string to avoid regexp issues
process.versions = {};
function noop() {}
process.on = noop;
process.addListener = noop;
process.once = noop;
process.off = noop;
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;
process.binding = function (name) {
throw new Error('process.binding is not supported');
};
process.cwd = function () {
return '/';
};
process.chdir = function (dir) {
throw new Error('process.chdir is not supported');
};
process.umask = function () {
return 0;
};
/***/ },
/* 22 */
/***/ function(module, exports, __webpack_require__) {
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _syntaxhighlighterHtmlRenderer = __webpack_require__(9);
var _syntaxhighlighterHtmlRenderer2 = _interopRequireDefault(_syntaxhighlighterHtmlRenderer);
var _syntaxhighlighterRegex = __webpack_require__(3);
var _syntaxhighlighterMatch = __webpack_require__(5);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
module.exports = function () {
function BrushBase() {
_classCallCheck(this, BrushBase);
}
_createClass(BrushBase, [{
key: 'getKeywords',
/**
* Converts space separated list of keywords into a regular expression string.
* @param {String} str Space separated keywords.
* @return {String} Returns regular expression string.
*/
value: function getKeywords(str) {
var results = str.replace(/^\s+|\s+$/g, '').replace(/\s+/g, '|');
return '\\b(?:' + results + ')\\b';
}
/**
* Makes a brush compatible with the `html-script` functionality.
* @param {Object} regexGroup Object containing `left` and `right` regular expressions.
*/
}, {
key: 'forHtmlScript',
value: function forHtmlScript(regexGroup) {
var regex = { 'end': regexGroup.right.source };
if (regexGroup.eof) {
regex.end = '(?:(?:' + regex.end + ')|$)';
}
this.htmlScript = {
left: { regex: regexGroup.left, css: 'script' },
right: { regex: regexGroup.right, css: 'script' },
code: (0, _syntaxhighlighterRegex.XRegExp)("(?.*?)" + "(?" + regex.end + ")", "sgi")
};
}
}, {
key: 'getHtml',
value: function getHtml(code) {
var params = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
var matches = (0, _syntaxhighlighterMatch.applyRegexList)(code, this.regexList);
var renderer = new _syntaxhighlighterHtmlRenderer2.default(code, matches, params);
return renderer.getHtml();
}
}]);
return BrushBase;
}();
/***/ },
/* 23 */
/***/ function(module, exports, __webpack_require__) {
var BrushBase = __webpack_require__(22);
var regexLib = __webpack_require__(3).commonRegExp;
function Brush() {
var keywords = 'abstract assert boolean break byte case catch char class const ' + 'continue default do double else enum extends ' + 'false final finally float for goto if implements import ' + 'instanceof int interface long native new null ' + 'package private protected public return ' + 'short static strictfp super switch synchronized this throw throws true ' + 'transient try void volatile while';
this.regexList = [{
regex: regexLib.singleLineCComments,
css: 'comments'
}, {
regex: /\/\*([^\*][\s\S]*?)?\*\//gm,
css: 'comments'
}, {
regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm,
css: 'preprocessor'
}, {
regex: regexLib.doubleQuotedString,
css: 'string'
}, {
regex: regexLib.singleQuotedString,
css: 'string'
}, {
regex: /\b([\d]+(\.[\d]+)?f?|[\d]+l?|0x[a-f0-9]+)\b/gi,
css: 'value'
}, {
regex: /(?!\@interface\b)\@[\$\w]+\b/g,
css: 'color1'
}, {
regex: /\@interface\b/g,
css: 'color2'
}, {
regex: new RegExp(this.getKeywords(keywords), 'gm'),
css: 'keyword'
}];
this.forHtmlScript({
left: /(<|<)%[@!=]?/g,
right: /%(>|>)/g
});
};
Brush.prototype = new BrushBase();
Brush.aliases = ['java'];
module.exports = Brush;
/***/ },
/* 24 */
/***/ function(module, exports, __webpack_require__) {
var BrushBase = __webpack_require__(22);
var regexLib = __webpack_require__(3).commonRegExp;
var XRegExp = __webpack_require__(3).XRegExp;
var Match = __webpack_require__(5).Match;
function Brush() {
function hereDocProcess(match, regexInfo) {
var result = [];
if (match.here_doc != null) result.push(new Match(match.here_doc, match.index + match[0].indexOf(match.here_doc), 'string'));
if (match.full_tag != null) result.push(new Match(match.full_tag, match.index, 'preprocessor'));
if (match.end_tag != null) result.push(new Match(match.end_tag, match.index + match[0].lastIndexOf(match.end_tag), 'preprocessor'));
return result;
}
var keywords = 'if fi then elif else for do done until while break continue case esac function return in eq ne ge le';
var commands = 'alias apropos awk basename base64 bash bc bg builtin bunzip2 bzcat bzip2 bzip2recover cal cat cd cfdisk chgrp chmod chown chroot' + 'cksum clear cmp comm command cp cron crontab crypt csplit cut date dc dd ddrescue declare df ' + 'diff diff3 dig dir dircolors dirname dirs du echo egrep eject enable env ethtool eval ' + 'exec exit expand export expr false fdformat fdisk fg fgrep file find fmt fold format ' + 'free fsck ftp gawk gcc gdb getconf getopts grep groups gunzip gzcat gzip hash head history hostname id ifconfig ' + 'import install join kill less let ln local locate logname logout look lpc lpr lprint ' + 'lprintd lprintq lprm ls lsof make man mkdir mkfifo mkisofs mknod more mount mtools ' + 'mv nasm nc ndisasm netstat nice nl nohup nslookup objdump od open op passwd paste pathchk ping popd pr printcap ' + 'printenv printf ps pushd pwd quota quotacheck quotactl ram rcp read readonly renice ' + 'remsync rm rmdir rsync screen scp sdiff sed select seq set sftp shift shopt shutdown ' + 'sleep sort source split ssh strace strings su sudo sum symlink sync tail tar tee test time ' + 'times touch top traceroute trap tr true tsort tty type ulimit umask umount unalias ' + 'uname unexpand uniq units unset unshar useradd usermod users uuencode uudecode v vdir ' + 'vi watch wc whereis which who whoami Wget xargs xxd yes chsh zcat';
this.regexList = [{
regex: /^#!.*$/gm,
css: 'preprocessor bold'
}, {
regex: /\/[\w-\/]+/gm,
css: 'plain'
}, {
regex: regexLib.singleLinePerlComments,
css: 'comments'
}, {
regex: regexLib.doubleQuotedString,
css: 'string'
}, {
regex: regexLib.singleQuotedString,
css: 'string'
}, {
regex: new RegExp(this.getKeywords(keywords), 'gm'),
css: 'keyword'
}, {
regex: new RegExp(this.getKeywords(commands), 'gm'),
css: 'functions'
}, {
regex: new XRegExp("(?(<|<){2}(?\\w+)) .*$(?[\\s\\S]*)(?^\\k$)", 'gm'),
func: hereDocProcess
}];
}
Brush.prototype = new BrushBase();
Brush.aliases = ['bash', 'shell', 'sh'];
module.exports = Brush;
/***/ },
/* 25 */
/***/ function(module, exports, __webpack_require__) {
var BrushBase = __webpack_require__(22);
var regexLib = __webpack_require__(3).commonRegExp;
function Brush() {
// Contributed by Erik Peterson.
var keywords = 'alias and BEGIN begin break case class def define_method defined do each else elsif ' + 'END end ensure false for if in module new next nil not or raise redo rescue retry return ' + 'self super then throw true undef unless until when while yield';
var builtins = 'Array Bignum Binding Class Continuation Dir Exception FalseClass File::Stat File Fixnum Fload ' + 'Hash Integer IO MatchData Method Module NilClass Numeric Object Proc Range Regexp String Struct::TMS Symbol ' + 'ThreadGroup Thread Time TrueClass';
this.regexList = [{
regex: regexLib.singleLinePerlComments,
css: 'comments'
}, {
regex: regexLib.doubleQuotedString,
css: 'string'
}, {
regex: regexLib.singleQuotedString,
css: 'string'
}, {
regex: /\b[A-Z0-9_]+\b/g,
css: 'constants'
}, {
regex: /:[a-z][A-Za-z0-9_]*/g,
css: 'color2'
}, {
regex: /(\$|@@|@)\w+/g,
css: 'variable bold'
}, {
regex: new RegExp(this.getKeywords(keywords), 'gm'),
css: 'keyword'
}, {
regex: new RegExp(this.getKeywords(builtins), 'gm'),
css: 'color1'
}];
this.forHtmlScript(regexLib.aspScriptTags);
};
Brush.prototype = new BrushBase();
Brush.aliases = ['ruby', 'rails', 'ror', 'rb'];
module.exports = Brush;
/***/ },
/* 26 */
/***/ function(module, exports, __webpack_require__) {
var BrushBase = __webpack_require__(22);
var regexLib = __webpack_require__(3).commonRegExp;
function Brush() {
// Contributed by Gheorghe Milas and Ahmad Sherif
var keywords = 'and assert break class continue def del elif else ' + 'except exec finally for from global if import in is ' + 'lambda not or pass raise return try yield while';
var funcs = '__import__ abs all any apply basestring bin bool buffer callable ' + 'chr classmethod cmp coerce compile complex delattr dict dir ' + 'divmod enumerate eval execfile file filter float format frozenset ' + 'getattr globals hasattr hash help hex id input int intern ' + 'isinstance issubclass iter len list locals long map max min next ' + 'object oct open ord pow print property range raw_input reduce ' + 'reload repr reversed round set setattr slice sorted staticmethod ' + 'str sum super tuple type type unichr unicode vars xrange zip';
var special = 'None True False self cls class_';
this.regexList = [{
regex: regexLib.singleLinePerlComments,
css: 'comments'
}, {
regex: /^\s*@\w+/gm,
css: 'decorator'
}, {
regex: /(['\"]{3})([^\1])*?\1/gm,
css: 'comments'
}, {
regex: /"(?!")(?:\.|\\\"|[^\""\n])*"/gm,
css: 'string'
}, {
regex: /'(?!')(?:\.|(\\\')|[^\''\n])*'/gm,
css: 'string'
}, {
regex: /\+|\-|\*|\/|\%|=|==/gm,
css: 'keyword'
}, {
regex: /\b\d+\.?\w*/g,
css: 'value'
}, {
regex: new RegExp(this.getKeywords(funcs), 'gmi'),
css: 'functions'
}, {
regex: new RegExp(this.getKeywords(keywords), 'gm'),
css: 'keyword'
}, {
regex: new RegExp(this.getKeywords(special), 'gm'),
css: 'color1'
}];
this.forHtmlScript(regexLib.aspScriptTags);
};
Brush.prototype = new BrushBase();
Brush.aliases = ['py', 'python'];
module.exports = Brush;
/***/ },
/* 27 */
/***/ function(module, exports, __webpack_require__) {
var BrushBase = __webpack_require__(22);
var regexLib = __webpack_require__(3).commonRegExp;
function Brush() {
// Copyright 2006 Shin, YoungJin
var datatypes = 'ATOM BOOL BOOLEAN BYTE CHAR COLORREF DWORD DWORDLONG DWORD_PTR ' + 'DWORD32 DWORD64 FLOAT HACCEL HALF_PTR HANDLE HBITMAP HBRUSH ' + 'HCOLORSPACE HCONV HCONVLIST HCURSOR HDC HDDEDATA HDESK HDROP HDWP ' + 'HENHMETAFILE HFILE HFONT HGDIOBJ HGLOBAL HHOOK HICON HINSTANCE HKEY ' + 'HKL HLOCAL HMENU HMETAFILE HMODULE HMONITOR HPALETTE HPEN HRESULT ' + 'HRGN HRSRC HSZ HWINSTA HWND INT INT_PTR INT32 INT64 LANGID LCID LCTYPE ' + 'LGRPID LONG LONGLONG LONG_PTR LONG32 LONG64 LPARAM LPBOOL LPBYTE LPCOLORREF ' + 'LPCSTR LPCTSTR LPCVOID LPCWSTR LPDWORD LPHANDLE LPINT LPLONG LPSTR LPTSTR ' + 'LPVOID LPWORD LPWSTR LRESULT PBOOL PBOOLEAN PBYTE PCHAR PCSTR PCTSTR PCWSTR ' + 'PDWORDLONG PDWORD_PTR PDWORD32 PDWORD64 PFLOAT PHALF_PTR PHANDLE PHKEY PINT ' + 'PINT_PTR PINT32 PINT64 PLCID PLONG PLONGLONG PLONG_PTR PLONG32 PLONG64 POINTER_32 ' + 'POINTER_64 PSHORT PSIZE_T PSSIZE_T PSTR PTBYTE PTCHAR PTSTR PUCHAR PUHALF_PTR ' + 'PUINT PUINT_PTR PUINT32 PUINT64 PULONG PULONGLONG PULONG_PTR PULONG32 PULONG64 ' + 'PUSHORT PVOID PWCHAR PWORD PWSTR SC_HANDLE SC_LOCK SERVICE_STATUS_HANDLE SHORT ' + 'SIZE_T SSIZE_T TBYTE TCHAR UCHAR UHALF_PTR UINT UINT_PTR UINT32 UINT64 ULONG ' + 'ULONGLONG ULONG_PTR ULONG32 ULONG64 USHORT USN VOID WCHAR WORD WPARAM WPARAM WPARAM ' + 'char char16_t char32_t bool short int __int32 __int64 __int8 __int16 long float double __wchar_t ' + 'clock_t _complex _dev_t _diskfree_t div_t ldiv_t _exception _EXCEPTION_POINTERS ' + 'FILE _finddata_t _finddatai64_t _wfinddata_t _wfinddatai64_t __finddata64_t ' + '__wfinddata64_t _FPIEEE_RECORD fpos_t _HEAPINFO _HFILE lconv intptr_t ' + 'jmp_buf mbstate_t _off_t _onexit_t _PNH ptrdiff_t _purecall_handler ' + 'sig_atomic_t size_t _stat __stat64 _stati64 terminate_function ' + 'time_t __time64_t _timeb __timeb64 tm uintptr_t _utimbuf ' + 'va_list wchar_t wctrans_t wctype_t wint_t signed';
var keywords = 'alignas alignof auto break case catch class const constexpr decltype __finally __exception __try ' + 'const_cast continue private public protected __declspec ' + 'default delete deprecated dllexport dllimport do dynamic_cast ' + 'else enum explicit extern if for friend goto inline ' + 'mutable naked namespace new noinline noreturn nothrow noexcept nullptr ' + 'register reinterpret_cast return selectany ' + 'sizeof static static_cast static_assert struct switch template this ' + 'thread thread_local throw true false try typedef typeid typename union ' + 'using uuid virtual void volatile whcar_t while';
var functions = 'assert isalnum isalpha iscntrl isdigit isgraph islower isprint ' + 'ispunct isspace isupper isxdigit tolower toupper errno localeconv ' + 'setlocale acos asin atan atan2 ceil cos cosh exp fabs floor fmod ' + 'frexp ldexp log log10 modf pow sin sinh sqrt tan tanh jmp_buf ' + 'longjmp setjmp raise signal sig_atomic_t va_arg va_end va_start ' + 'clearerr fclose feof ferror fflush fgetc fgetpos fgets fopen ' + 'fprintf fputc fputs fread freopen fscanf fseek fsetpos ftell ' + 'fwrite getc getchar gets perror printf putc putchar puts remove ' + 'rename rewind scanf setbuf setvbuf sprintf sscanf tmpfile tmpnam ' + 'ungetc vfprintf vprintf vsprintf abort abs atexit atof atoi atol ' + 'bsearch calloc div exit free getenv labs ldiv malloc mblen mbstowcs ' + 'mbtowc qsort rand realloc srand strtod strtol strtoul system ' + 'wcstombs wctomb memchr memcmp memcpy memmove memset strcat strchr ' + 'strcmp strcoll strcpy strcspn strerror strlen strncat strncmp ' + 'strncpy strpbrk strrchr strspn strstr strtok strxfrm asctime ' + 'clock ctime difftime gmtime localtime mktime strftime time';
this.regexList = [{
regex: regexLib.singleLineCComments,
css: 'comments'
}, {
regex: regexLib.multiLineCComments,
css: 'comments'
}, {
regex: regexLib.doubleQuotedString,
css: 'string'
}, {
regex: regexLib.singleQuotedString,
css: 'string'
}, {
regex: /^ *#.*/gm,
css: 'preprocessor'
}, {
regex: new RegExp(this.getKeywords(datatypes), 'gm'),
css: 'color1 bold'
}, {
regex: new RegExp(this.getKeywords(functions), 'gm'),
css: 'functions bold'
}, {
regex: new RegExp(this.getKeywords(keywords), 'gm'),
css: 'keyword bold'
}];
};
Brush.prototype = new BrushBase();
Brush.aliases = ['cpp', 'cc', 'c++', 'c', 'h', 'hpp', 'h++'];
module.exports = Brush;
/***/ },
/* 28 */
/***/ function(module, exports, __webpack_require__) {
var BrushBase = __webpack_require__(22);
var regexLib = __webpack_require__(3).commonRegExp;
var Match = __webpack_require__(5).Match;
function Brush() {
var keywords = 'abstract as base bool break byte case catch char checked class const ' + 'continue decimal default delegate do double else enum event explicit volatile ' + 'extern false finally fixed float for foreach get goto if implicit in int ' + 'interface internal is lock long namespace new null object operator out ' + 'override params private protected public readonly ref return sbyte sealed set ' + 'short sizeof stackalloc static string struct switch this throw true try ' + 'typeof uint ulong unchecked unsafe ushort using virtual void while var ' + 'from group by into select let where orderby join on equals ascending descending';
function fixComments(match, regexInfo) {
var css = match[0].indexOf("///") == 0 ? 'color1' : 'comments';
return [new Match(match[0], match.index, css)];
}
this.regexList = [{
regex: regexLib.singleLineCComments,
func: fixComments
}, {
regex: regexLib.multiLineCComments,
css: 'comments'
}, {
regex: /@"(?:[^"]|"")*"/g,
css: 'string'
}, {
regex: regexLib.doubleQuotedString,
css: 'string'
}, {
regex: regexLib.singleQuotedString,
css: 'string'
}, {
regex: /^\s*#.*/gm,
css: 'preprocessor'
}, {
regex: new RegExp(this.getKeywords(keywords), 'gm'),
css: 'keyword'
}, {
regex: /\bpartial(?=\s+(?:class|interface|struct)\b)/g,
css: 'keyword'
}, {
regex: /\byield(?=\s+(?:return|break)\b)/g,
css: 'keyword'
}];
this.forHtmlScript(regexLib.aspScriptTags);
};
Brush.prototype = new BrushBase();
Brush.aliases = ['c#', 'c-sharp', 'csharp'];
module.exports = Brush;
/***/ },
/* 29 */
/***/ function(module, exports, __webpack_require__) {
var BrushBase = __webpack_require__(22);
var regexLib = __webpack_require__(3).commonRegExp;
function Brush() {
// Contributed by David Simmons-Duffin and Marty Kube
var funcs = 'abs accept alarm atan2 bind binmode chdir chmod chomp chop chown chr ' + 'chroot close closedir connect cos crypt defined delete each endgrent ' + 'endhostent endnetent endprotoent endpwent endservent eof exec exists ' + 'exp fcntl fileno flock fork format formline getc getgrent getgrgid ' + 'getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr ' + 'getnetbyname getnetent getpeername getpgrp getppid getpriority ' + 'getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid ' + 'getservbyname getservbyport getservent getsockname getsockopt glob ' + 'gmtime grep hex index int ioctl join keys kill lc lcfirst length link ' + 'listen localtime lock log lstat map mkdir msgctl msgget msgrcv msgsnd ' + 'oct open opendir ord pack pipe pop pos print printf prototype push ' + 'quotemeta rand read readdir readline readlink readpipe recv rename ' + 'reset reverse rewinddir rindex rmdir scalar seek seekdir select semctl ' + 'semget semop send setgrent sethostent setnetent setpgrp setpriority ' + 'setprotoent setpwent setservent setsockopt shift shmctl shmget shmread ' + 'shmwrite shutdown sin sleep socket socketpair sort splice split sprintf ' + 'sqrt srand stat study substr symlink syscall sysopen sysread sysseek ' + 'system syswrite tell telldir time times tr truncate uc ucfirst umask ' + 'undef unlink unpack unshift utime values vec wait waitpid warn write ' +
// feature
'say';
var keywords = 'bless caller continue dbmclose dbmopen die do dump else elsif eval exit ' + 'for foreach goto if import last local my next no our package redo ref ' + 'require return sub tie tied unless untie until use wantarray while ' +
// feature
'given when default ' +
// Try::Tiny
'try catch finally ' +
// Moose
'has extends with before after around override augment';
this.regexList = [{
regex: /(<<|<<)((\w+)|(['"])(.+?)\4)[\s\S]+?\n\3\5\n/g,
css: 'string'
}, {
regex: /#.*$/gm,
css: 'comments'
}, {
regex: /^#!.*\n/g,
css: 'preprocessor'
}, {
regex: /-?\w+(?=\s*=(>|>))/g,
css: 'string'
},
// is this too much?
{
regex: /\bq[qwxr]?\([\s\S]*?\)/g,
css: 'string'
}, {
regex: /\bq[qwxr]?\{[\s\S]*?\}/g,
css: 'string'
}, {
regex: /\bq[qwxr]?\[[\s\S]*?\]/g,
css: 'string'
}, {
regex: /\bq[qwxr]?(<|<)[\s\S]*?(>|>)/g,
css: 'string'
}, {
regex: /\bq[qwxr]?([^\w({<[])[\s\S]*?\1/g,
css: 'string'
}, {
regex: regexLib.doubleQuotedString,
css: 'string'
}, {
regex: regexLib.singleQuotedString,
css: 'string'
}, {
regex: /(?:&|[$@%*]|\$#)\$?[a-zA-Z_](\w+|::)*/g,
css: 'variable'
}, {
regex: /\b__(?:END|DATA)__\b[\s\S]*$/g,
css: 'comments'
}, {
regex: /(^|\n)=\w[\s\S]*?(\n=cut\s*(?=\n)|$)/g,
css: 'comments'
}, {
regex: new RegExp(this.getKeywords(funcs), 'gm'),
css: 'functions'
}, {
regex: new RegExp(this.getKeywords(keywords), 'gm'),
css: 'keyword'
}];
this.forHtmlScript(regexLib.phpScriptTags);
}
Brush.prototype = new BrushBase();
Brush.aliases = ['perl', 'Perl', 'pl'];
module.exports = Brush;
/***/ },
/* 30 */
/***/ function(module, exports, __webpack_require__) {
var BrushBase = __webpack_require__(22);
var regexLib = __webpack_require__(3).commonRegExp;
function Brush() {
var funcs = 'abs avg case cast coalesce convert count current_timestamp ' + 'current_user day isnull left lower month nullif replace right ' + 'session_user space substring sum system_user upper user year';
var keywords = 'absolute action add after alter as asc at authorization begin bigint ' + 'binary bit by cascade char character check checkpoint close collate ' + 'column commit committed connect connection constraint contains continue ' + 'create cube current current_date current_time cursor database date ' + 'deallocate dec decimal declare default delete desc distinct double drop ' + 'dynamic else end end-exec escape except exec execute false fetch first ' + 'float for force foreign forward free from full function global goto grant ' + 'group grouping having hour ignore index inner insensitive insert instead ' + 'int integer intersect into is isolation key last level load local max min ' + 'minute modify move name national nchar next no numeric of off on only ' + 'open option order out output partial password precision prepare primary ' + 'prior privileges procedure public read real references relative repeatable ' + 'restrict return returns revoke rollback rollup rows rule schema scroll ' + 'second section select sequence serializable set size smallint static ' + 'statistics table temp temporary then time timestamp to top transaction ' + 'translation trigger true truncate uncommitted union unique update values ' + 'varchar varying view when where with work';
var operators = 'all and any between cross in join like not null or outer some';
this.regexList = [{
regex: /--(.*)$/gm,
css: 'comments'
}, {
regex: /\/\*([^\*][\s\S]*?)?\*\//gm,
css: 'comments'
}, {
regex: regexLib.multiLineDoubleQuotedString,
css: 'string'
}, {
regex: regexLib.multiLineSingleQuotedString,
css: 'string'
}, {
regex: new RegExp(this.getKeywords(funcs), 'gmi'),
css: 'color2'
}, {
regex: new RegExp(this.getKeywords(operators), 'gmi'),
css: 'color1'
}, {
regex: new RegExp(this.getKeywords(keywords), 'gmi'),
css: 'keyword'
}];
};
Brush.prototype = new BrushBase();
Brush.aliases = ['sql'];
module.exports = Brush;
/***/ },
/* 31 */
/***/ function(module, exports, __webpack_require__) {
var BrushBase = __webpack_require__(22);
var regexLib = __webpack_require__(3).commonRegExp;
function Brush() {
this.regexList = [];
};
Brush.prototype = new BrushBase();
Brush.aliases = ['text', 'plain'];
module.exports = Brush;
/***/ },
/* 32 */
/***/ function(module, exports, __webpack_require__) {
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
/*!
* domready (c) Dustin Diaz 2014 - License MIT
*/
!function (name, definition) {
if (true) module.exports = definition();else if (typeof define == 'function' && _typeof(define.amd) == 'object') define(definition);else this[name] = definition();
}('domready', function () {
var fns = [],
_listener,
doc = document,
hack = doc.documentElement.doScroll,
domContentLoaded = 'DOMContentLoaded',
loaded = (hack ? /^loaded|^c/ : /^loaded|^i|^c/).test(doc.readyState);
if (!loaded) doc.addEventListener(domContentLoaded, _listener = function listener() {
doc.removeEventListener(domContentLoaded, _listener);
loaded = 1;
while (_listener = fns.shift()) {
_listener();
}
});
return function (fn) {
loaded ? setTimeout(fn, 0) : fns.push(fn);
};
});
/***/ },
/* 33 */
/***/ function(module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
var string = exports.string = function string(value) {
return value.replace(/^([A-Z])/g, function (_, character) {
return character.toLowerCase();
}).replace(/([A-Z])/g, function (_, character) {
return '-' + character.toLowerCase();
});
};
var object = exports.object = function object(value) {
var result = {};
Object.keys(value).forEach(function (key) {
return result[string(key)] = value[key];
});
return result;
};
/***/ }
/******/ ]);
//# sourceMappingURL=syntaxhighlighter.js.map