Created
September 11, 2017 04:55
-
-
Save MoOx/3feede6e8cc19e061589bdc2f6634bef to your computer and use it in GitHub Desktop.
requirebin sketch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var unified = require('unified'); | |
var markdown = require('remark-parse'); | |
var remark2rehype = require('remark-rehype'); | |
var slug = require('rehype-slug'); | |
var link = require('rehype-autolink-headings'); | |
var raw = require('rehype-raw'); | |
var stringify = require('rehype-stringify'); | |
const input = `## Test | |
[link](href) | |
\`\`\`js | |
console.log(window) | |
\`\`\` | |
<button>Random Html</button> | |
<Button>Random react like stuff</Button> | |
`; | |
unified() | |
.use(markdown) | |
.use(remark2rehype, {allowDangerousHTML: true}) | |
.use(slug) | |
.use(link) | |
.use(raw) | |
.use(stringify) | |
.processSync(input); |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setTimeout(function(){ | |
;require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | |
(function (process){ | |
// Copyright Joyent, Inc. and other Node contributors. | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a | |
// copy of this software and associated documentation files (the | |
// "Software"), to deal in the Software without restriction, including | |
// without limitation the rights to use, copy, modify, merge, publish, | |
// distribute, sublicense, and/or sell copies of the Software, and to permit | |
// persons to whom the Software is furnished to do so, subject to the | |
// following conditions: | |
// | |
// The above copyright notice and this permission notice shall be included | |
// in all copies or substantial portions of the Software. | |
// | |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | |
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN | |
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, | |
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR | |
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE | |
// USE OR OTHER DEALINGS IN THE SOFTWARE. | |
// resolves . and .. elements in a path array with directory names there | |
// must be no slashes, empty elements, or device names (c:\) in the array | |
// (so also no leading and trailing slashes - it does not distinguish | |
// relative and absolute paths) | |
function normalizeArray(parts, allowAboveRoot) { | |
// if the path tries to go above the root, `up` ends up > 0 | |
var up = 0; | |
for (var i = parts.length - 1; i >= 0; i--) { | |
var last = parts[i]; | |
if (last === '.') { | |
parts.splice(i, 1); | |
} else if (last === '..') { | |
parts.splice(i, 1); | |
up++; | |
} else if (up) { | |
parts.splice(i, 1); | |
up--; | |
} | |
} | |
// if the path is allowed to go above the root, restore leading ..s | |
if (allowAboveRoot) { | |
for (; up--; up) { | |
parts.unshift('..'); | |
} | |
} | |
return parts; | |
} | |
// Split a filename into [root, dir, basename, ext], unix version | |
// 'root' is just a slash, or nothing. | |
var splitPathRe = | |
/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; | |
var splitPath = function(filename) { | |
return splitPathRe.exec(filename).slice(1); | |
}; | |
// path.resolve([from ...], to) | |
// posix version | |
exports.resolve = function() { | |
var resolvedPath = '', | |
resolvedAbsolute = false; | |
for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { | |
var path = (i >= 0) ? arguments[i] : process.cwd(); | |
// Skip empty and invalid entries | |
if (typeof path !== 'string') { | |
throw new TypeError('Arguments to path.resolve must be strings'); | |
} else if (!path) { | |
continue; | |
} | |
resolvedPath = path + '/' + resolvedPath; | |
resolvedAbsolute = path.charAt(0) === '/'; | |
} | |
// At this point the path should be resolved to a full absolute path, but | |
// handle relative paths to be safe (might happen when process.cwd() fails) | |
// Normalize the path | |
resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) { | |
return !!p; | |
}), !resolvedAbsolute).join('/'); | |
return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; | |
}; | |
// path.normalize(path) | |
// posix version | |
exports.normalize = function(path) { | |
var isAbsolute = exports.isAbsolute(path), | |
trailingSlash = substr(path, -1) === '/'; | |
// Normalize the path | |
path = normalizeArray(filter(path.split('/'), function(p) { | |
return !!p; | |
}), !isAbsolute).join('/'); | |
if (!path && !isAbsolute) { | |
path = '.'; | |
} | |
if (path && trailingSlash) { | |
path += '/'; | |
} | |
return (isAbsolute ? '/' : '') + path; | |
}; | |
// posix version | |
exports.isAbsolute = function(path) { | |
return path.charAt(0) === '/'; | |
}; | |
// posix version | |
exports.join = function() { | |
var paths = Array.prototype.slice.call(arguments, 0); | |
return exports.normalize(filter(paths, function(p, index) { | |
if (typeof p !== 'string') { | |
throw new TypeError('Arguments to path.join must be strings'); | |
} | |
return p; | |
}).join('/')); | |
}; | |
// path.relative(from, to) | |
// posix version | |
exports.relative = function(from, to) { | |
from = exports.resolve(from).substr(1); | |
to = exports.resolve(to).substr(1); | |
function trim(arr) { | |
var start = 0; | |
for (; start < arr.length; start++) { | |
if (arr[start] !== '') break; | |
} | |
var end = arr.length - 1; | |
for (; end >= 0; end--) { | |
if (arr[end] !== '') break; | |
} | |
if (start > end) return []; | |
return arr.slice(start, end - start + 1); | |
} | |
var fromParts = trim(from.split('/')); | |
var toParts = trim(to.split('/')); | |
var length = Math.min(fromParts.length, toParts.length); | |
var samePartsLength = length; | |
for (var i = 0; i < length; i++) { | |
if (fromParts[i] !== toParts[i]) { | |
samePartsLength = i; | |
break; | |
} | |
} | |
var outputParts = []; | |
for (var i = samePartsLength; i < fromParts.length; i++) { | |
outputParts.push('..'); | |
} | |
outputParts = outputParts.concat(toParts.slice(samePartsLength)); | |
return outputParts.join('/'); | |
}; | |
exports.sep = '/'; | |
exports.delimiter = ':'; | |
exports.dirname = function(path) { | |
var result = splitPath(path), | |
root = result[0], | |
dir = result[1]; | |
if (!root && !dir) { | |
// No dirname whatsoever | |
return '.'; | |
} | |
if (dir) { | |
// It has a dirname, strip trailing slash | |
dir = dir.substr(0, dir.length - 1); | |
} | |
return root + dir; | |
}; | |
exports.basename = function(path, ext) { | |
var f = splitPath(path)[2]; | |
// TODO: make this comparison case-insensitive on windows? | |
if (ext && f.substr(-1 * ext.length) === ext) { | |
f = f.substr(0, f.length - ext.length); | |
} | |
return f; | |
}; | |
exports.extname = function(path) { | |
return splitPath(path)[3]; | |
}; | |
function filter (xs, f) { | |
if (xs.filter) return xs.filter(f); | |
var res = []; | |
for (var i = 0; i < xs.length; i++) { | |
if (f(xs[i], i, xs)) res.push(xs[i]); | |
} | |
return res; | |
} | |
// String.prototype.substr - negative index don't work in IE8 | |
var substr = 'ab'.substr(-1) === 'b' | |
? function (str, start, len) { return str.substr(start, len) } | |
: function (str, start, len) { | |
if (start < 0) start = str.length + start; | |
return str.substr(start, len); | |
} | |
; | |
}).call(this,require('_process')) | |
},{"_process":2}],2:[function(require,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 defaultSetTimout() { | |
throw new Error('setTimeout has not been defined'); | |
} | |
function defaultClearTimeout () { | |
throw new Error('clearTimeout has not been defined'); | |
} | |
(function () { | |
try { | |
if (typeof setTimeout === 'function') { | |
cachedSetTimeout = setTimeout; | |
} else { | |
cachedSetTimeout = defaultSetTimout; | |
} | |
} catch (e) { | |
cachedSetTimeout = defaultSetTimout; | |
} | |
try { | |
if (typeof clearTimeout === 'function') { | |
cachedClearTimeout = clearTimeout; | |
} else { | |
cachedClearTimeout = defaultClearTimeout; | |
} | |
} catch (e) { | |
cachedClearTimeout = defaultClearTimeout; | |
} | |
} ()) | |
function runTimeout(fun) { | |
if (cachedSetTimeout === setTimeout) { | |
//normal enviroments in sane situations | |
return setTimeout(fun, 0); | |
} | |
// if setTimeout wasn't available but was latter defined | |
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { | |
cachedSetTimeout = setTimeout; | |
return setTimeout(fun, 0); | |
} | |
try { | |
// when when somebody has screwed with setTimeout but no I.E. maddness | |
return cachedSetTimeout(fun, 0); | |
} catch(e){ | |
try { | |
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally | |
return cachedSetTimeout.call(null, fun, 0); | |
} catch(e){ | |
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error | |
return cachedSetTimeout.call(this, fun, 0); | |
} | |
} | |
} | |
function runClearTimeout(marker) { | |
if (cachedClearTimeout === clearTimeout) { | |
//normal enviroments in sane situations | |
return clearTimeout(marker); | |
} | |
// if clearTimeout wasn't available but was latter defined | |
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { | |
cachedClearTimeout = clearTimeout; | |
return clearTimeout(marker); | |
} | |
try { | |
// when when somebody has screwed with setTimeout but no I.E. maddness | |
return cachedClearTimeout(marker); | |
} catch (e){ | |
try { | |
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally | |
return cachedClearTimeout.call(null, marker); | |
} catch (e){ | |
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. | |
// Some versions of I.E. have different rules for clearTimeout vs setTimeout | |
return cachedClearTimeout.call(this, 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; }; | |
},{}],3:[function(require,module,exports){ | |
'use strict'; | |
module.exports = bail; | |
function bail(err) { | |
if (err) { | |
throw err; | |
} | |
} | |
},{}],4:[function(require,module,exports){ | |
'use strict'; | |
var hasOwn = Object.prototype.hasOwnProperty; | |
var toStr = Object.prototype.toString; | |
var isArray = function isArray(arr) { | |
if (typeof Array.isArray === 'function') { | |
return Array.isArray(arr); | |
} | |
return toStr.call(arr) === '[object Array]'; | |
}; | |
var isPlainObject = function isPlainObject(obj) { | |
if (!obj || toStr.call(obj) !== '[object Object]') { | |
return false; | |
} | |
var hasOwnConstructor = hasOwn.call(obj, 'constructor'); | |
var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); | |
// Not own constructor property must be Object | |
if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { | |
return false; | |
} | |
// Own properties are enumerated firstly, so to speed up, | |
// if last one is own, then all properties are own. | |
var key; | |
for (key in obj) { /**/ } | |
return typeof key === 'undefined' || hasOwn.call(obj, key); | |
}; | |
module.exports = function extend() { | |
var options, name, src, copy, copyIsArray, clone; | |
var target = arguments[0]; | |
var i = 1; | |
var length = arguments.length; | |
var deep = false; | |
// Handle a deep copy situation | |
if (typeof target === 'boolean') { | |
deep = target; | |
target = arguments[1] || {}; | |
// skip the boolean and the target | |
i = 2; | |
} | |
if (target == null || (typeof target !== 'object' && typeof target !== 'function')) { | |
target = {}; | |
} | |
for (; i < length; ++i) { | |
options = arguments[i]; | |
// Only deal with non-null/undefined values | |
if (options != null) { | |
// Extend the base object | |
for (name in options) { | |
src = target[name]; | |
copy = options[name]; | |
// Prevent never-ending loop | |
if (target !== copy) { | |
// Recurse if we're merging plain objects or arrays | |
if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { | |
if (copyIsArray) { | |
copyIsArray = false; | |
clone = src && isArray(src) ? src : []; | |
} else { | |
clone = src && isPlainObject(src) ? src : {}; | |
} | |
// Never move original objects, clone them | |
target[name] = extend(deep, clone, copy); | |
// Don't bring in undefined values | |
} else if (typeof copy !== 'undefined') { | |
target[name] = copy; | |
} | |
} | |
} | |
} | |
} | |
// Return the modified object | |
return target; | |
}; | |
},{}],5:[function(require,module,exports){ | |
'use strict'; | |
var toString = Object.prototype.toString; | |
module.exports = function (x) { | |
var prototype; | |
return toString.call(x) === '[object Object]' && (prototype = Object.getPrototypeOf(x), prototype === null || prototype === Object.getPrototypeOf({})); | |
}; | |
},{}],6:[function(require,module,exports){ | |
'use strict'; | |
/* Expose. */ | |
module.exports = trough; | |
/* Methods. */ | |
var slice = [].slice; | |
/* Create new middleware. */ | |
function trough() { | |
var fns = []; | |
var middleware = {}; | |
middleware.run = run; | |
middleware.use = use; | |
return middleware; | |
/* Run `fns`. Last argument must be | |
* a completion handler. */ | |
function run() { | |
var index = -1; | |
var input = slice.call(arguments, 0, -1); | |
var done = arguments[arguments.length - 1]; | |
if (typeof done !== 'function') { | |
throw new Error('Expected function as last argument, not ' + done); | |
} | |
next.apply(null, [null].concat(input)); | |
/* Run the next `fn`, if any. */ | |
function next(err) { | |
var fn = fns[++index]; | |
var params = slice.call(arguments, 0); | |
var values = params.slice(1); | |
var length = input.length; | |
var pos = -1; | |
if (err) { | |
done(err); | |
return; | |
} | |
/* Copy non-nully input into values. */ | |
while (++pos < length) { | |
if (values[pos] === null || values[pos] === undefined) { | |
values[pos] = input[pos]; | |
} | |
} | |
input = values; | |
/* Next or done. */ | |
if (fn) { | |
wrap(fn, next).apply(null, input); | |
} else { | |
done.apply(null, [null].concat(input)); | |
} | |
} | |
} | |
/* Add `fn` to the list. */ | |
function use(fn) { | |
if (typeof fn !== 'function') { | |
throw new Error('Expected `fn` to be a function, not ' + fn); | |
} | |
fns.push(fn); | |
return middleware; | |
} | |
} | |
/* Wrap `fn`. Can be sync or async; return a promise, | |
* receive a completion handler, return new values and | |
* errors. */ | |
function wrap(fn, next) { | |
var invoked; | |
return wrapped; | |
function wrapped() { | |
var params = slice.call(arguments, 0); | |
var callback = fn.length > params.length; | |
var result; | |
if (callback) { | |
params.push(done); | |
} | |
try { | |
result = fn.apply(null, params); | |
} catch (err) { | |
/* Well, this is quite the pickle. `fn` received | |
* a callback and invoked it (thus continuing the | |
* pipeline), but later also threw an error. | |
* We’re not about to restart the pipeline again, | |
* so the only thing left to do is to throw the | |
* thing instea. */ | |
if (callback && invoked) { | |
throw err; | |
} | |
return done(err); | |
} | |
if (!callback) { | |
if (result && typeof result.then === 'function') { | |
result.then(then, done); | |
} else if (result instanceof Error) { | |
done(result); | |
} else { | |
then(result); | |
} | |
} | |
} | |
/* Invoke `next`, only once. */ | |
function done() { | |
if (!invoked) { | |
invoked = true; | |
next.apply(null, arguments); | |
} | |
} | |
/* Invoke `done` with one value. | |
* Tracks if an error is passed, too. */ | |
function then(value) { | |
done(null, value); | |
} | |
} | |
},{}],7:[function(require,module,exports){ | |
(function (process){ | |
'use strict'; | |
var path = require('path'); | |
var replace = require('replace-ext'); | |
var stringify = require('unist-util-stringify-position'); | |
var buffer = require('is-buffer'); | |
module.exports = VFile; | |
var own = {}.hasOwnProperty; | |
var proto = VFile.prototype; | |
proto.toString = toString; | |
proto.message = message; | |
proto.info = info; | |
proto.fail = fail; | |
/* Slight backwards compatibility. Remove in the future. */ | |
proto.warn = message; | |
/* Order of setting (least specific to most), we need this because | |
* otherwise `{stem: 'a', path: '~/b.js'}` would throw, as a path | |
* is needed before a stem can be set. */ | |
var order = [ | |
'history', | |
'path', | |
'basename', | |
'stem', | |
'extname', | |
'dirname' | |
]; | |
/* Construct a new file. */ | |
function VFile(options) { | |
var prop; | |
var index; | |
var length; | |
if (!options) { | |
options = {}; | |
} else if (typeof options === 'string' || buffer(options)) { | |
options = {contents: options}; | |
} else if ('message' in options && 'messages' in options) { | |
return options; | |
} | |
if (!(this instanceof VFile)) { | |
return new VFile(options); | |
} | |
this.data = {}; | |
this.messages = []; | |
this.history = []; | |
this.cwd = process.cwd(); | |
/* Set path related properties in the correct order. */ | |
index = -1; | |
length = order.length; | |
while (++index < length) { | |
prop = order[index]; | |
if (own.call(options, prop)) { | |
this[prop] = options[prop]; | |
} | |
} | |
/* Set non-path related properties. */ | |
for (prop in options) { | |
if (order.indexOf(prop) === -1) { | |
this[prop] = options[prop]; | |
} | |
} | |
} | |
/* Access full path (`~/index.min.js`). */ | |
Object.defineProperty(proto, 'path', { | |
get: function () { | |
return this.history[this.history.length - 1]; | |
}, | |
set: function (path) { | |
assertNonEmpty(path, 'path'); | |
if (path !== this.path) { | |
this.history.push(path); | |
} | |
} | |
}); | |
/* Access parent path (`~`). */ | |
Object.defineProperty(proto, 'dirname', { | |
get: function () { | |
return typeof this.path === 'string' ? path.dirname(this.path) : undefined; | |
}, | |
set: function (dirname) { | |
assertPath(this.path, 'dirname'); | |
this.path = path.join(dirname || '', this.basename); | |
} | |
}); | |
/* Access basename (`index.min.js`). */ | |
Object.defineProperty(proto, 'basename', { | |
get: function () { | |
return typeof this.path === 'string' ? path.basename(this.path) : undefined; | |
}, | |
set: function (basename) { | |
assertNonEmpty(basename, 'basename'); | |
assertPart(basename, 'basename'); | |
this.path = path.join(this.dirname || '', basename); | |
} | |
}); | |
/* Access extname (`.js`). */ | |
Object.defineProperty(proto, 'extname', { | |
get: function () { | |
return typeof this.path === 'string' ? path.extname(this.path) : undefined; | |
}, | |
set: function (extname) { | |
var ext = extname || ''; | |
assertPart(ext, 'extname'); | |
assertPath(this.path, 'extname'); | |
if (ext) { | |
if (ext.charAt(0) !== '.') { | |
throw new Error('`extname` must start with `.`'); | |
} | |
if (ext.indexOf('.', 1) !== -1) { | |
throw new Error('`extname` cannot contain multiple dots'); | |
} | |
} | |
this.path = replace(this.path, ext); | |
} | |
}); | |
/* Access stem (`index.min`). */ | |
Object.defineProperty(proto, 'stem', { | |
get: function () { | |
return typeof this.path === 'string' ? path.basename(this.path, this.extname) : undefined; | |
}, | |
set: function (stem) { | |
assertNonEmpty(stem, 'stem'); | |
assertPart(stem, 'stem'); | |
this.path = path.join(this.dirname || '', stem + (this.extname || '')); | |
} | |
}); | |
/* Get the value of the file. */ | |
function toString(encoding) { | |
var value = this.contents || ''; | |
return buffer(value) ? value.toString(encoding) : String(value); | |
} | |
/* Create a message with `reason` at `position`. | |
* When an error is passed in as `reason`, copies the stack. */ | |
function message(reason, position, ruleId) { | |
var filePath = this.path; | |
var range = stringify(position) || '1:1'; | |
var location; | |
var err; | |
location = { | |
start: {line: null, column: null}, | |
end: {line: null, column: null} | |
}; | |
if (position && position.position) { | |
position = position.position; | |
} | |
if (position) { | |
/* Location. */ | |
if (position.start) { | |
location = position; | |
position = position.start; | |
} else { | |
/* Position. */ | |
location.start = position; | |
} | |
} | |
err = new VMessage(reason.message || reason); | |
err.name = (filePath ? filePath + ':' : '') + range; | |
err.file = filePath || ''; | |
err.reason = reason.message || reason; | |
err.line = position ? position.line : null; | |
err.column = position ? position.column : null; | |
err.location = location; | |
err.ruleId = ruleId || null; | |
err.source = null; | |
err.fatal = false; | |
if (reason.stack) { | |
err.stack = reason.stack; | |
} | |
this.messages.push(err); | |
return err; | |
} | |
/* Fail. Creates a vmessage, associates it with the file, | |
* and throws it. */ | |
function fail() { | |
var message = this.message.apply(this, arguments); | |
message.fatal = true; | |
throw message; | |
} | |
/* Info. Creates a vmessage, associates it with the file, | |
* and marks the fatality as null. */ | |
function info() { | |
var message = this.message.apply(this, arguments); | |
message.fatal = null; | |
return message; | |
} | |
/* Inherit from `Error#`. */ | |
function VMessagePrototype() {} | |
VMessagePrototype.prototype = Error.prototype; | |
VMessage.prototype = new VMessagePrototype(); | |
/* Message properties. */ | |
proto = VMessage.prototype; | |
proto.file = ''; | |
proto.name = ''; | |
proto.reason = ''; | |
proto.message = ''; | |
proto.stack = ''; | |
proto.fatal = null; | |
proto.column = null; | |
proto.line = null; | |
/* Construct a new file message. | |
* | |
* Note: We cannot invoke `Error` on the created context, | |
* as that adds readonly `line` and `column` attributes on | |
* Safari 9, thus throwing and failing the data. */ | |
function VMessage(reason) { | |
this.message = reason; | |
} | |
/* Assert that `part` is not a path (i.e., does | |
* not contain `path.sep`). */ | |
function assertPart(part, name) { | |
if (part.indexOf(path.sep) !== -1) { | |
throw new Error('`' + name + '` cannot be a path: did not expect `' + path.sep + '`'); | |
} | |
} | |
/* Assert that `part` is not empty. */ | |
function assertNonEmpty(part, name) { | |
if (!part) { | |
throw new Error('`' + name + '` cannot be empty'); | |
} | |
} | |
/* Assert `path` exists. */ | |
function assertPath(path, name) { | |
if (!path) { | |
throw new Error('Setting `' + name + '` requires `path` to be set too'); | |
} | |
} | |
}).call(this,require('_process')) | |
},{"_process":2,"is-buffer":8,"path":1,"replace-ext":9,"unist-util-stringify-position":10}],8:[function(require,module,exports){ | |
/*! | |
* Determine if an object is a Buffer | |
* | |
* @author Feross Aboukhadijeh <[email protected]> <http://feross.org> | |
* @license MIT | |
*/ | |
// The _isBuffer check is for Safari 5-7 support, because it's missing | |
// Object.prototype.constructor. Remove this eventually | |
module.exports = function (obj) { | |
return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer) | |
} | |
function isBuffer (obj) { | |
return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) | |
} | |
// For Node v0.10 support. Remove this eventually. | |
function isSlowBuffer (obj) { | |
return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) | |
} | |
},{}],9:[function(require,module,exports){ | |
'use strict'; | |
var path = require('path'); | |
function replaceExt(npath, ext) { | |
if (typeof npath !== 'string') { | |
return npath; | |
} | |
if (npath.length === 0) { | |
return npath; | |
} | |
var nFileName = path.basename(npath, path.extname(npath)) + ext; | |
return path.join(path.dirname(npath), nFileName); | |
} | |
module.exports = replaceExt; | |
},{"path":1}],10:[function(require,module,exports){ | |
'use strict'; | |
var own = {}.hasOwnProperty; | |
module.exports = stringify; | |
function stringify(value) { | |
/* Nothing. */ | |
if (!value || typeof value !== 'object') { | |
return null; | |
} | |
/* Node. */ | |
if (own.call(value, 'position') || own.call(value, 'type')) { | |
return location(value.position); | |
} | |
/* Location. */ | |
if (own.call(value, 'start') || own.call(value, 'end')) { | |
return location(value); | |
} | |
/* Position. */ | |
if (own.call(value, 'line') || own.call(value, 'column')) { | |
return position(value); | |
} | |
/* ? */ | |
return null; | |
} | |
function position(pos) { | |
if (!pos || typeof pos !== 'object') { | |
pos = {}; | |
} | |
return index(pos.line) + ':' + index(pos.column); | |
} | |
function location(loc) { | |
if (!loc || typeof loc !== 'object') { | |
loc = {}; | |
} | |
return position(loc.start) + '-' + position(loc.end); | |
} | |
function index(value) { | |
return value && typeof value === 'number' ? value : 1; | |
} | |
},{}],11:[function(require,module,exports){ | |
module.exports = function isFunction (fn) { | |
return Object.prototype.toString.call(fn) === '[object Function]' | |
} | |
},{}],12:[function(require,module,exports){ | |
var toString = Object.prototype.toString | |
module.exports = isString | |
function isString(obj) { | |
return toString.call(obj) === "[object String]" | |
} | |
},{}],"unified":[function(require,module,exports){ | |
'use strict'; | |
/* Dependencies. */ | |
var extend = require('extend'); | |
var bail = require('bail'); | |
var vfile = require('vfile'); | |
var trough = require('trough'); | |
var string = require('x-is-string'); | |
var func = require('x-is-function'); | |
var plain = require('is-plain-obj'); | |
/* Expose a frozen processor. */ | |
module.exports = unified().freeze(); | |
var slice = [].slice; | |
var own = {}.hasOwnProperty; | |
/* Process pipeline. */ | |
var pipeline = trough().use(pipelineParse).use(pipelineRun).use(pipelineStringify); | |
function pipelineParse(p, ctx) { | |
ctx.tree = p.parse(ctx.file); | |
} | |
function pipelineRun(p, ctx, next) { | |
p.run(ctx.tree, ctx.file, done); | |
function done(err, tree, file) { | |
if (err) { | |
next(err); | |
} else { | |
ctx.tree = tree; | |
ctx.file = file; | |
next(); | |
} | |
} | |
} | |
function pipelineStringify(p, ctx) { | |
ctx.file.contents = p.stringify(ctx.tree, ctx.file); | |
} | |
/* Function to create the first processor. */ | |
function unified() { | |
var attachers = []; | |
var transformers = trough(); | |
var namespace = {}; | |
var frozen = false; | |
var freezeIndex = -1; | |
/* Data management. */ | |
processor.data = data; | |
/* Lock. */ | |
processor.freeze = freeze; | |
/* Plug-ins. */ | |
processor.attachers = attachers; | |
processor.use = use; | |
/* API. */ | |
processor.parse = parse; | |
processor.stringify = stringify; | |
processor.run = run; | |
processor.runSync = runSync; | |
processor.process = process; | |
processor.processSync = processSync; | |
/* Expose. */ | |
return processor; | |
/* Create a new processor based on the processor | |
* in the current scope. */ | |
function processor() { | |
var destination = unified(); | |
var length = attachers.length; | |
var index = -1; | |
while (++index < length) { | |
destination.use.apply(null, attachers[index]); | |
} | |
destination.data(extend(true, {}, namespace)); | |
return destination; | |
} | |
/* Freeze: used to signal a processor that has finished | |
* configuration. | |
* | |
* For example, take unified itself. It’s frozen. | |
* Plug-ins should not be added to it. Rather, it should | |
* be extended, by invoking it, before modifying it. | |
* | |
* In essence, always invoke this when exporting a | |
* processor. */ | |
function freeze() { | |
var values; | |
var plugin; | |
var options; | |
var transformer; | |
if (frozen) { | |
return processor; | |
} | |
while (++freezeIndex < attachers.length) { | |
values = attachers[freezeIndex]; | |
plugin = values[0]; | |
options = values[1]; | |
transformer = null; | |
if (options === false) { | |
continue; | |
} | |
if (options === true) { | |
values[1] = undefined; | |
} | |
transformer = plugin.apply(processor, values.slice(1)); | |
if (func(transformer)) { | |
transformers.use(transformer); | |
} | |
} | |
frozen = true; | |
freezeIndex = Infinity; | |
return processor; | |
} | |
/* Data management. | |
* Getter / setter for processor-specific informtion. */ | |
function data(key, value) { | |
if (string(key)) { | |
/* Set `key`. */ | |
if (arguments.length === 2) { | |
assertUnfrozen('data', frozen); | |
namespace[key] = value; | |
return processor; | |
} | |
/* Get `key`. */ | |
return (own.call(namespace, key) && namespace[key]) || null; | |
} | |
/* Set space. */ | |
if (key) { | |
assertUnfrozen('data', frozen); | |
namespace = key; | |
return processor; | |
} | |
/* Get space. */ | |
return namespace; | |
} | |
/* Plug-in management. | |
* | |
* Pass it: | |
* * an attacher and options, | |
* * a preset, | |
* * a list of presets, attachers, and arguments (list | |
* of attachers and options). */ | |
function use(value) { | |
var settings; | |
assertUnfrozen('use', frozen); | |
if (value === null || value === undefined) { | |
/* Empty */ | |
} else if (func(value)) { | |
addPlugin.apply(null, arguments); | |
} else if (typeof value === 'object') { | |
if ('length' in value) { | |
addList(value); | |
} else { | |
addPreset(value); | |
} | |
} else { | |
throw new Error('Expected usable value, not `' + value + '`'); | |
} | |
if (settings) { | |
namespace.settings = extend(namespace.settings || {}, settings); | |
} | |
return processor; | |
function addPreset(result) { | |
addList(result.plugins); | |
if (result.settings) { | |
settings = extend(settings || {}, result.settings); | |
} | |
} | |
function add(value) { | |
if (func(value)) { | |
addPlugin(value); | |
} else if (typeof value === 'object') { | |
if ('length' in value) { | |
addPlugin.apply(null, value); | |
} else { | |
addPreset(value); | |
} | |
} else { | |
throw new Error('Expected usable value, not `' + value + '`'); | |
} | |
} | |
function addList(plugins) { | |
var length; | |
var index; | |
if (plugins === null || plugins === undefined) { | |
/* Empty */ | |
} else if (typeof plugins === 'object' && 'length' in plugins) { | |
length = plugins.length; | |
index = -1; | |
while (++index < length) { | |
add(plugins[index]); | |
} | |
} else { | |
throw new Error('Expected a list of plugins, not `' + plugins + '`'); | |
} | |
} | |
function addPlugin(plugin, value) { | |
var entry = find(plugin); | |
if (entry) { | |
if (plain(entry[1]) && plain(value)) { | |
value = extend(entry[1], value); | |
} | |
entry[1] = value; | |
} else { | |
attachers.push(slice.call(arguments)); | |
} | |
} | |
} | |
function find(plugin) { | |
var length = attachers.length; | |
var index = -1; | |
var entry; | |
while (++index < length) { | |
entry = attachers[index]; | |
if (entry[0] === plugin) { | |
return entry; | |
} | |
} | |
} | |
/* Parse a file (in string or VFile representation) | |
* into a Unist node using the `Parser` on the | |
* processor. */ | |
function parse(doc) { | |
var file = vfile(doc); | |
var Parser; | |
freeze(); | |
Parser = processor.Parser; | |
assertParser('parse', Parser); | |
if (newable(Parser)) { | |
return new Parser(String(file), file).parse(); | |
} | |
return Parser(String(file), file); // eslint-disable-line new-cap | |
} | |
/* Run transforms on a Unist node representation of a file | |
* (in string or VFile representation), async. */ | |
function run(node, file, cb) { | |
assertNode(node); | |
freeze(); | |
if (!cb && func(file)) { | |
cb = file; | |
file = null; | |
} | |
if (!cb) { | |
return new Promise(executor); | |
} | |
executor(null, cb); | |
function executor(resolve, reject) { | |
transformers.run(node, vfile(file), done); | |
function done(err, tree, file) { | |
tree = tree || node; | |
if (err) { | |
reject(err); | |
} else if (resolve) { | |
resolve(tree); | |
} else { | |
cb(null, tree, file); | |
} | |
} | |
} | |
} | |
/* Run transforms on a Unist node representation of a file | |
* (in string or VFile representation), sync. */ | |
function runSync(node, file) { | |
var complete = false; | |
var result; | |
run(node, file, done); | |
assertDone('runSync', 'run', complete); | |
return result; | |
function done(err, tree) { | |
complete = true; | |
bail(err); | |
result = tree; | |
} | |
} | |
/* Stringify a Unist node representation of a file | |
* (in string or VFile representation) into a string | |
* using the `Compiler` on the processor. */ | |
function stringify(node, doc) { | |
var file = vfile(doc); | |
var Compiler; | |
freeze(); | |
Compiler = processor.Compiler; | |
assertCompiler('stringify', Compiler); | |
assertNode(node); | |
if (newable(Compiler)) { | |
return new Compiler(node, file).compile(); | |
} | |
return Compiler(node, file); // eslint-disable-line new-cap | |
} | |
/* Parse a file (in string or VFile representation) | |
* into a Unist node using the `Parser` on the processor, | |
* then run transforms on that node, and compile the | |
* resulting node using the `Compiler` on the processor, | |
* and store that result on the VFile. */ | |
function process(doc, cb) { | |
freeze(); | |
assertParser('process', processor.Parser); | |
assertCompiler('process', processor.Compiler); | |
if (!cb) { | |
return new Promise(executor); | |
} | |
executor(null, cb); | |
function executor(resolve, reject) { | |
var file = vfile(doc); | |
pipeline.run(processor, {file: file}, done); | |
function done(err) { | |
if (err) { | |
reject(err); | |
} else if (resolve) { | |
resolve(file); | |
} else { | |
cb(null, file); | |
} | |
} | |
} | |
} | |
/* Process the given document (in string or VFile | |
* representation), sync. */ | |
function processSync(doc) { | |
var complete = false; | |
var file; | |
freeze(); | |
assertParser('processSync', processor.Parser); | |
assertCompiler('processSync', processor.Compiler); | |
file = vfile(doc); | |
process(file, done); | |
assertDone('processSync', 'process', complete); | |
return file; | |
function done(err) { | |
complete = true; | |
bail(err); | |
} | |
} | |
} | |
/* Check if `func` is a constructor. */ | |
function newable(value) { | |
return func(value) && keys(value.prototype); | |
} | |
/* Check if `value` is an object with keys. */ | |
function keys(value) { | |
var key; | |
for (key in value) { | |
return true; | |
} | |
return false; | |
} | |
/* Assert a parser is available. */ | |
function assertParser(name, Parser) { | |
if (!func(Parser)) { | |
throw new Error('Cannot `' + name + '` without `Parser`'); | |
} | |
} | |
/* Assert a compiler is available. */ | |
function assertCompiler(name, Compiler) { | |
if (!func(Compiler)) { | |
throw new Error('Cannot `' + name + '` without `Compiler`'); | |
} | |
} | |
/* Assert the processor is not frozen. */ | |
function assertUnfrozen(name, frozen) { | |
if (frozen) { | |
throw new Error( | |
'Cannot invoke `' + name + '` on a frozen processor.\n' + | |
'Create a new processor first, by invoking it: ' + | |
'use `processor()` instead of `processor`.' | |
); | |
} | |
} | |
/* Assert `node` is a Unist node. */ | |
function assertNode(node) { | |
if (!node || !string(node.type)) { | |
throw new Error('Expected node, got `' + node + '`'); | |
} | |
} | |
/* Assert that `complete` is `true`. */ | |
function assertDone(name, asyncName, complete) { | |
if (!complete) { | |
throw new Error('`' + name + '` finished async. Use `' + asyncName + '` instead'); | |
} | |
} | |
},{"bail":3,"extend":4,"is-plain-obj":5,"trough":6,"vfile":7,"x-is-function":11,"x-is-string":12}]},{},[]) | |
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2hvbWUvYWRtaW4vYnJvd3NlcmlmeS1jZG4vbm9kZV9tb2R1bGVzL2Jyb3dzZXJpZnkvbm9kZV9tb2R1bGVzL2Jyb3dzZXItcGFjay9fcHJlbHVkZS5qcyIsIi4uLy4uLy4uLy4uL2hvbWUvYWRtaW4vYnJvd3NlcmlmeS1jZG4vbm9kZV9tb2R1bGVzL2Jyb3dzZXJpZnkvbm9kZV9tb2R1bGVzL3BhdGgtYnJvd3NlcmlmeS9pbmRleC5qcyIsIi4uLy4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c3NlcnROb2RlKG5vZGUpIHtcbiAgaWYgKCFub2RlIHx8ICFzdHJpbmcobm9kZS50eXBlKSkge1xuICAgIHRocm93IG5ldyBFcnJvcignRXhwZWN0ZWQgbm9kZSwgZ290IGAnICsgbm9kZSArICdgJyk7XG4gIH1cbn1cblxuLyogQXNzZXJ0IHRoYXQgYGNvbXBsZXRlYCBpcyBgdHJ1ZWAuICovXG5mdW5jdGlvbiBhc3NlcnREb25lKG5hbWUsIGFzeW5jTmFtZSwgY29tcGxldGUpIHtcbiAgaWYgKCFjb21wbGV0ZSkge1xuICAgIHRocm93IG5ldyBFcnJvcignYCcgKyBuYW1lICsgJ2AgZmluaXNoZWQgYXN5bmMuIFVzZSBgJyArIGFzeW5jTmFtZSArICdgIGluc3RlYWQnKTtcbiAgfVxufVxuIl19 | |
require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | |
module.exports=[ | |
"address", | |
"article", | |
"aside", | |
"base", | |
"basefont", | |
"blockquote", | |
"body", | |
"caption", | |
"center", | |
"col", | |
"colgroup", | |
"dd", | |
"details", | |
"dialog", | |
"dir", | |
"div", | |
"dl", | |
"dt", | |
"fieldset", | |
"figcaption", | |
"figure", | |
"footer", | |
"form", | |
"frame", | |
"frameset", | |
"h1", | |
"h2", | |
"h3", | |
"h4", | |
"h5", | |
"h6", | |
"head", | |
"header", | |
"hgroup", | |
"hr", | |
"html", | |
"iframe", | |
"legend", | |
"li", | |
"link", | |
"main", | |
"menu", | |
"menuitem", | |
"meta", | |
"nav", | |
"noframes", | |
"ol", | |
"optgroup", | |
"option", | |
"p", | |
"param", | |
"pre", | |
"section", | |
"source", | |
"title", | |
"summary", | |
"table", | |
"tbody", | |
"td", | |
"tfoot", | |
"th", | |
"thead", | |
"title", | |
"tr", | |
"track", | |
"ul" | |
] | |
},{}],2:[function(require,module,exports){ | |
'use strict'; | |
var entities = require('parse-entities'); | |
module.exports = factory; | |
/* Factory to create an entity decoder. */ | |
function factory(ctx) { | |
decoder.raw = decodeRaw; | |
return decoder; | |
/* Normalize `position` to add an `indent`. */ | |
function normalize(position) { | |
var offsets = ctx.offset; | |
var line = position.line; | |
var result = []; | |
while (++line) { | |
if (!(line in offsets)) { | |
break; | |
} | |
result.push((offsets[line] || 0) + 1); | |
} | |
return { | |
start: position, | |
indent: result | |
}; | |
} | |
/* Handle a warning. | |
* See https://github.com/wooorm/parse-entities | |
* for the warnings. */ | |
function handleWarning(reason, position, code) { | |
if (code === 3) { | |
return; | |
} | |
ctx.file.message(reason, position); | |
} | |
/* Decode `value` (at `position`) into text-nodes. */ | |
function decoder(value, position, handler) { | |
entities(value, { | |
position: normalize(position), | |
warning: handleWarning, | |
text: handler, | |
reference: handler, | |
textContext: ctx, | |
referenceContext: ctx | |
}); | |
} | |
/* Decode `value` (at `position`) into a string. */ | |
function decodeRaw(value, position) { | |
return entities(value, { | |
position: normalize(position), | |
warning: handleWarning | |
}); | |
} | |
} | |
},{"parse-entities":54}],3:[function(require,module,exports){ | |
'use strict'; | |
module.exports = { | |
position: true, | |
gfm: true, | |
commonmark: false, | |
footnotes: false, | |
pedantic: false, | |
blocks: require('./block-elements.json') | |
}; | |
},{"./block-elements.json":1}],4:[function(require,module,exports){ | |
'use strict'; | |
module.exports = locate; | |
function locate(value, fromIndex) { | |
var index = value.indexOf('\n', fromIndex); | |
while (index > fromIndex) { | |
if (value.charAt(index - 1) !== ' ') { | |
break; | |
} | |
index--; | |
} | |
return index; | |
} | |
},{}],5:[function(require,module,exports){ | |
'use strict'; | |
module.exports = locate; | |
function locate(value, fromIndex) { | |
return value.indexOf('`', fromIndex); | |
} | |
},{}],6:[function(require,module,exports){ | |
'use strict'; | |
module.exports = locate; | |
function locate(value, fromIndex) { | |
return value.indexOf('~~', fromIndex); | |
} | |
},{}],7:[function(require,module,exports){ | |
'use strict'; | |
module.exports = locate; | |
function locate(value, fromIndex) { | |
var asterisk = value.indexOf('*', fromIndex); | |
var underscore = value.indexOf('_', fromIndex); | |
if (underscore === -1) { | |
return asterisk; | |
} | |
if (asterisk === -1) { | |
return underscore; | |
} | |
return underscore < asterisk ? underscore : asterisk; | |
} | |
},{}],8:[function(require,module,exports){ | |
'use strict'; | |
module.exports = locate; | |
function locate(value, fromIndex) { | |
return value.indexOf('\\', fromIndex); | |
} | |
},{}],9:[function(require,module,exports){ | |
'use strict'; | |
module.exports = locate; | |
function locate(value, fromIndex) { | |
var link = value.indexOf('[', fromIndex); | |
var image = value.indexOf('![', fromIndex); | |
if (image === -1) { | |
return link; | |
} | |
/* Link can never be `-1` if an image is found, so we don’t need | |
* to check for that :) */ | |
return link < image ? link : image; | |
} | |
},{}],10:[function(require,module,exports){ | |
'use strict'; | |
module.exports = locate; | |
function locate(value, fromIndex) { | |
var asterisk = value.indexOf('**', fromIndex); | |
var underscore = value.indexOf('__', fromIndex); | |
if (underscore === -1) { | |
return asterisk; | |
} | |
if (asterisk === -1) { | |
return underscore; | |
} | |
return underscore < asterisk ? underscore : asterisk; | |
} | |
},{}],11:[function(require,module,exports){ | |
'use strict'; | |
module.exports = locate; | |
function locate(value, fromIndex) { | |
return value.indexOf('<', fromIndex); | |
} | |
},{}],12:[function(require,module,exports){ | |
'use strict'; | |
module.exports = locate; | |
var PROTOCOLS = ['https://', 'http://', 'mailto:']; | |
function locate(value, fromIndex) { | |
var length = PROTOCOLS.length; | |
var index = -1; | |
var min = -1; | |
var position; | |
if (!this.options.gfm) { | |
return -1; | |
} | |
while (++index < length) { | |
position = value.indexOf(PROTOCOLS[index], fromIndex); | |
if (position !== -1 && (position < min || min === -1)) { | |
min = position; | |
} | |
} | |
return min; | |
} | |
},{}],13:[function(require,module,exports){ | |
'use strict'; | |
var xtend = require('xtend'); | |
var removePosition = require('unist-util-remove-position'); | |
module.exports = parse; | |
var C_NEWLINE = '\n'; | |
var EXPRESSION_LINE_BREAKS = /\r\n|\r/g; | |
/* Parse the bound file. */ | |
function parse() { | |
var self = this; | |
var value = String(self.file); | |
var start = {line: 1, column: 1, offset: 0}; | |
var content = xtend(start); | |
var node; | |
/* Clean non-unix newlines: `\r\n` and `\r` are all | |
* changed to `\n`. This should not affect positional | |
* information. */ | |
value = value.replace(EXPRESSION_LINE_BREAKS, C_NEWLINE); | |
if (value.charCodeAt(0) === 0xFEFF) { | |
value = value.slice(1); | |
content.column++; | |
content.offset++; | |
} | |
node = { | |
type: 'root', | |
children: self.tokenizeBlock(value, content), | |
position: { | |
start: start, | |
end: self.eof || xtend(start) | |
} | |
}; | |
if (!self.options.position) { | |
removePosition(node, true); | |
} | |
return node; | |
} | |
},{"unist-util-remove-position":66,"xtend":69}],14:[function(require,module,exports){ | |
'use strict'; | |
var xtend = require('xtend'); | |
var toggle = require('state-toggle'); | |
var vfileLocation = require('vfile-location'); | |
var unescape = require('./unescape'); | |
var decode = require('./decode'); | |
var tokenizer = require('./tokenizer'); | |
module.exports = Parser; | |
function Parser(doc, file) { | |
this.file = file; | |
this.offset = {}; | |
this.options = xtend(this.options); | |
this.setOptions({}); | |
this.inList = false; | |
this.inBlock = false; | |
this.inLink = false; | |
this.atStart = true; | |
this.toOffset = vfileLocation(file).toOffset; | |
this.unescape = unescape(this, 'escape'); | |
this.decode = decode(this); | |
} | |
var proto = Parser.prototype; | |
/* Expose core. */ | |
proto.setOptions = require('./set-options'); | |
proto.parse = require('./parse'); | |
/* Expose `defaults`. */ | |
proto.options = require('./defaults'); | |
/* Enter and exit helpers. */ | |
proto.exitStart = toggle('atStart', true); | |
proto.enterList = toggle('inList', false); | |
proto.enterLink = toggle('inLink', false); | |
proto.enterBlock = toggle('inBlock', false); | |
/* Nodes that can interupt a paragraph: | |
* | |
* ```markdown | |
* A paragraph, followed by a thematic break. | |
* ___ | |
* ``` | |
* | |
* In the above example, the thematic break “interupts” | |
* the paragraph. */ | |
proto.interruptParagraph = [ | |
['thematicBreak'], | |
['atxHeading'], | |
['fencedCode'], | |
['blockquote'], | |
['html'], | |
['setextHeading', {commonmark: false}], | |
['definition', {commonmark: false}], | |
['footnote', {commonmark: false}] | |
]; | |
/* Nodes that can interupt a list: | |
* | |
* ```markdown | |
* - One | |
* ___ | |
* ``` | |
* | |
* In the above example, the thematic break “interupts” | |
* the list. */ | |
proto.interruptList = [ | |
['fencedCode', {pedantic: false}], | |
['thematicBreak', {pedantic: false}], | |
['definition', {commonmark: false}], | |
['footnote', {commonmark: false}] | |
]; | |
/* Nodes that can interupt a blockquote: | |
* | |
* ```markdown | |
* > A paragraph. | |
* ___ | |
* ``` | |
* | |
* In the above example, the thematic break “interupts” | |
* the blockquote. */ | |
proto.interruptBlockquote = [ | |
['indentedCode', {commonmark: true}], | |
['fencedCode', {commonmark: true}], | |
['atxHeading', {commonmark: true}], | |
['setextHeading', {commonmark: true}], | |
['thematicBreak', {commonmark: true}], | |
['html', {commonmark: true}], | |
['list', {commonmark: true}], | |
['definition', {commonmark: false}], | |
['footnote', {commonmark: false}] | |
]; | |
/* Handlers. */ | |
proto.blockTokenizers = { | |
newline: require('./tokenize/newline'), | |
indentedCode: require('./tokenize/code-indented'), | |
fencedCode: require('./tokenize/code-fenced'), | |
blockquote: require('./tokenize/blockquote'), | |
atxHeading: require('./tokenize/heading-atx'), | |
thematicBreak: require('./tokenize/thematic-break'), | |
list: require('./tokenize/list'), | |
setextHeading: require('./tokenize/heading-setext'), | |
html: require('./tokenize/html-block'), | |
footnote: require('./tokenize/footnote-definition'), | |
definition: require('./tokenize/definition'), | |
table: require('./tokenize/table'), | |
paragraph: require('./tokenize/paragraph') | |
}; | |
proto.inlineTokenizers = { | |
escape: require('./tokenize/escape'), | |
autoLink: require('./tokenize/auto-link'), | |
url: require('./tokenize/url'), | |
html: require('./tokenize/html-inline'), | |
link: require('./tokenize/link'), | |
reference: require('./tokenize/reference'), | |
strong: require('./tokenize/strong'), | |
emphasis: require('./tokenize/emphasis'), | |
deletion: require('./tokenize/delete'), | |
code: require('./tokenize/code-inline'), | |
break: require('./tokenize/break'), | |
text: require('./tokenize/text') | |
}; | |
/* Expose precedence. */ | |
proto.blockMethods = keys(proto.blockTokenizers); | |
proto.inlineMethods = keys(proto.inlineTokenizers); | |
/* Tokenizers. */ | |
proto.tokenizeBlock = tokenizer('block'); | |
proto.tokenizeInline = tokenizer('inline'); | |
proto.tokenizeFactory = tokenizer; | |
/* Get all keys in `value`. */ | |
function keys(value) { | |
var result = []; | |
var key; | |
for (key in value) { | |
result.push(key); | |
} | |
return result; | |
} | |
},{"./decode":2,"./defaults":3,"./parse":13,"./set-options":15,"./tokenize/auto-link":16,"./tokenize/blockquote":17,"./tokenize/break":18,"./tokenize/code-fenced":19,"./tokenize/code-indented":20,"./tokenize/code-inline":21,"./tokenize/definition":22,"./tokenize/delete":23,"./tokenize/emphasis":24,"./tokenize/escape":25,"./tokenize/footnote-definition":26,"./tokenize/heading-atx":27,"./tokenize/heading-setext":28,"./tokenize/html-block":29,"./tokenize/html-inline":30,"./tokenize/link":31,"./tokenize/list":32,"./tokenize/newline":33,"./tokenize/paragraph":34,"./tokenize/reference":35,"./tokenize/strong":36,"./tokenize/table":37,"./tokenize/text":38,"./tokenize/thematic-break":39,"./tokenize/url":40,"./tokenizer":41,"./unescape":42,"state-toggle":61,"vfile-location":68,"xtend":69}],15:[function(require,module,exports){ | |
'use strict'; | |
var xtend = require('xtend'); | |
var escapes = require('markdown-escapes'); | |
var defaults = require('./defaults'); | |
module.exports = setOptions; | |
function setOptions(options) { | |
var self = this; | |
var current = self.options; | |
var key; | |
var value; | |
if (options == null) { | |
options = {}; | |
} else if (typeof options === 'object') { | |
options = xtend(options); | |
} else { | |
throw new Error( | |
'Invalid value `' + options + '` ' + | |
'for setting `options`' | |
); | |
} | |
for (key in defaults) { | |
value = options[key]; | |
if (value == null) { | |
value = current[key]; | |
} | |
if ( | |
(key !== 'blocks' && typeof value !== 'boolean') || | |
(key === 'blocks' && typeof value !== 'object') | |
) { | |
throw new Error('Invalid value `' + value + '` for setting `options.' + key + '`'); | |
} | |
options[key] = value; | |
} | |
self.options = options; | |
self.escape = escapes(options); | |
return self; | |
} | |
},{"./defaults":3,"markdown-escapes":53,"xtend":69}],16:[function(require,module,exports){ | |
'use strict'; | |
var whitespace = require('is-whitespace-character'); | |
var decode = require('parse-entities'); | |
var locate = require('../locate/tag'); | |
module.exports = autoLink; | |
autoLink.locator = locate; | |
autoLink.notInLink = true; | |
var C_LT = '<'; | |
var C_GT = '>'; | |
var C_AT_SIGN = '@'; | |
var C_SLASH = '/'; | |
var MAILTO = 'mailto:'; | |
var MAILTO_LENGTH = MAILTO.length; | |
/* Tokenise a link. */ | |
function autoLink(eat, value, silent) { | |
var self; | |
var subvalue; | |
var length; | |
var index; | |
var queue; | |
var character; | |
var hasAtCharacter; | |
var link; | |
var now; | |
var content; | |
var tokenize; | |
var exit; | |
if (value.charAt(0) !== C_LT) { | |
return; | |
} | |
self = this; | |
subvalue = ''; | |
length = value.length; | |
index = 0; | |
queue = ''; | |
hasAtCharacter = false; | |
link = ''; | |
index++; | |
subvalue = C_LT; | |
while (index < length) { | |
character = value.charAt(index); | |
if ( | |
whitespace(character) || | |
character === C_GT || | |
character === C_AT_SIGN || | |
(character === ':' && value.charAt(index + 1) === C_SLASH) | |
) { | |
break; | |
} | |
queue += character; | |
index++; | |
} | |
if (!queue) { | |
return; | |
} | |
link += queue; | |
queue = ''; | |
character = value.charAt(index); | |
link += character; | |
index++; | |
if (character === C_AT_SIGN) { | |
hasAtCharacter = true; | |
} else { | |
if ( | |
character !== ':' || | |
value.charAt(index + 1) !== C_SLASH | |
) { | |
return; | |
} | |
link += C_SLASH; | |
index++; | |
} | |
while (index < length) { | |
character = value.charAt(index); | |
if (whitespace(character) || character === C_GT) { | |
break; | |
} | |
queue += character; | |
index++; | |
} | |
character = value.charAt(index); | |
if (!queue || character !== C_GT) { | |
return; | |
} | |
/* istanbul ignore if - never used (yet) */ | |
if (silent) { | |
return true; | |
} | |
link += queue; | |
content = link; | |
subvalue += link + character; | |
now = eat.now(); | |
now.column++; | |
now.offset++; | |
if (hasAtCharacter) { | |
if (link.slice(0, MAILTO_LENGTH).toLowerCase() === MAILTO) { | |
content = content.substr(MAILTO_LENGTH); | |
now.column += MAILTO_LENGTH; | |
now.offset += MAILTO_LENGTH; | |
} else { | |
link = MAILTO + link; | |
} | |
} | |
/* Temporarily remove support for escapes in autolinks. */ | |
tokenize = self.inlineTokenizers.escape; | |
self.inlineTokenizers.escape = null; | |
exit = self.enterLink(); | |
content = self.tokenizeInline(content, now); | |
self.inlineTokenizers.escape = tokenize; | |
exit(); | |
return eat(subvalue)({ | |
type: 'link', | |
title: null, | |
url: decode(link), | |
children: content | |
}); | |
} | |
},{"../locate/tag":11,"is-whitespace-character":51,"parse-entities":54}],17:[function(require,module,exports){ | |
'use strict'; | |
var trim = require('trim'); | |
var interrupt = require('../util/interrupt'); | |
module.exports = blockquote; | |
var C_NEWLINE = '\n'; | |
var C_TAB = '\t'; | |
var C_SPACE = ' '; | |
var C_GT = '>'; | |
/* Tokenise a blockquote. */ | |
function blockquote(eat, value, silent) { | |
var self = this; | |
var offsets = self.offset; | |
var tokenizers = self.blockTokenizers; | |
var interruptors = self.interruptBlockquote; | |
var now = eat.now(); | |
var currentLine = now.line; | |
var length = value.length; | |
var values = []; | |
var contents = []; | |
var indents = []; | |
var add; | |
var index = 0; | |
var character; | |
var rest; | |
var nextIndex; | |
var content; | |
var line; | |
var startIndex; | |
var prefixed; | |
var exit; | |
while (index < length) { | |
character = value.charAt(index); | |
if (character !== C_SPACE && character !== C_TAB) { | |
break; | |
} | |
index++; | |
} | |
if (value.charAt(index) !== C_GT) { | |
return; | |
} | |
if (silent) { | |
return true; | |
} | |
index = 0; | |
while (index < length) { | |
nextIndex = value.indexOf(C_NEWLINE, index); | |
startIndex = index; | |
prefixed = false; | |
if (nextIndex === -1) { | |
nextIndex = length; | |
} | |
while (index < length) { | |
character = value.charAt(index); | |
if (character !== C_SPACE && character !== C_TAB) { | |
break; | |
} | |
index++; | |
} | |
if (value.charAt(index) === C_GT) { | |
index++; | |
prefixed = true; | |
if (value.charAt(index) === C_SPACE) { | |
index++; | |
} | |
} else { | |
index = startIndex; | |
} | |
content = value.slice(index, nextIndex); | |
if (!prefixed && !trim(content)) { | |
index = startIndex; | |
break; | |
} | |
if (!prefixed) { | |
rest = value.slice(index); | |
/* Check if the following code contains a possible | |
* block. */ | |
if (interrupt(interruptors, tokenizers, self, [eat, rest, true])) { | |
break; | |
} | |
} | |
line = startIndex === index ? content : value.slice(startIndex, nextIndex); | |
indents.push(index - startIndex); | |
values.push(line); | |
contents.push(content); | |
index = nextIndex + 1; | |
} | |
index = -1; | |
length = indents.length; | |
add = eat(values.join(C_NEWLINE)); | |
while (++index < length) { | |
offsets[currentLine] = (offsets[currentLine] || 0) + indents[index]; | |
currentLine++; | |
} | |
exit = self.enterBlock(); | |
contents = self.tokenizeBlock(contents.join(C_NEWLINE), now); | |
exit(); | |
return add({ | |
type: 'blockquote', | |
children: contents | |
}); | |
} | |
},{"../util/interrupt":45,"trim":63}],18:[function(require,module,exports){ | |
'use strict'; | |
var locate = require('../locate/break'); | |
module.exports = hardBreak; | |
hardBreak.locator = locate; | |
var MIN_BREAK_LENGTH = 2; | |
function hardBreak(eat, value, silent) { | |
var length = value.length; | |
var index = -1; | |
var queue = ''; | |
var character; | |
while (++index < length) { | |
character = value.charAt(index); | |
if (character === '\n') { | |
if (index < MIN_BREAK_LENGTH) { | |
return; | |
} | |
/* istanbul ignore if - never used (yet) */ | |
if (silent) { | |
return true; | |
} | |
queue += character; | |
return eat(queue)({type: 'break'}); | |
} | |
if (character !== ' ') { | |
return; | |
} | |
queue += character; | |
} | |
} | |
},{"../locate/break":4}],19:[function(require,module,exports){ | |
'use strict'; | |
var trim = require('trim-trailing-lines'); | |
module.exports = fencedCode; | |
var C_NEWLINE = '\n'; | |
var C_TAB = '\t'; | |
var C_SPACE = ' '; | |
var C_TILDE = '~'; | |
var C_TICK = '`'; | |
var MIN_FENCE_COUNT = 3; | |
var CODE_INDENT_COUNT = 4; | |
function fencedCode(eat, value, silent) { | |
var self = this; | |
var settings = self.options; | |
var length = value.length + 1; | |
var index = 0; | |
var subvalue = ''; | |
var fenceCount; | |
var marker; | |
var character; | |
var flag; | |
var queue; | |
var content; | |
var exdentedContent; | |
var closing; | |
var exdentedClosing; | |
var indent; | |
var now; | |
if (!settings.gfm) { | |
return; | |
} | |
/* Eat initial spacing. */ | |
while (index < length) { | |
character = value.charAt(index); | |
if (character !== C_SPACE && character !== C_TAB) { | |
break; | |
} | |
subvalue += character; | |
index++; | |
} | |
indent = index; | |
/* Eat the fence. */ | |
character = value.charAt(index); | |
if (character !== C_TILDE && character !== C_TICK) { | |
return; | |
} | |
index++; | |
marker = character; | |
fenceCount = 1; | |
subvalue += character; | |
while (index < length) { | |
character = value.charAt(index); | |
if (character !== marker) { | |
break; | |
} | |
subvalue += character; | |
fenceCount++; | |
index++; | |
} | |
if (fenceCount < MIN_FENCE_COUNT) { | |
return; | |
} | |
/* Eat spacing before flag. */ | |
while (index < length) { | |
character = value.charAt(index); | |
if (character !== C_SPACE && character !== C_TAB) { | |
break; | |
} | |
subvalue += character; | |
index++; | |
} | |
/* Eat flag. */ | |
flag = ''; | |
queue = ''; | |
while (index < length) { | |
character = value.charAt(index); | |
if ( | |
character === C_NEWLINE || | |
character === C_TILDE || | |
character === C_TICK | |
) { | |
break; | |
} | |
if (character === C_SPACE || character === C_TAB) { | |
queue += character; | |
} else { | |
flag += queue + character; | |
queue = ''; | |
} | |
index++; | |
} | |
character = value.charAt(index); | |
if (character && character !== C_NEWLINE) { | |
return; | |
} | |
if (silent) { | |
return true; | |
} | |
now = eat.now(); | |
now.column += subvalue.length; | |
now.offset += subvalue.length; | |
subvalue += flag; | |
flag = self.decode.raw(self.unescape(flag), now); | |
if (queue) { | |
subvalue += queue; | |
} | |
queue = ''; | |
closing = ''; | |
exdentedClosing = ''; | |
content = ''; | |
exdentedContent = ''; | |
/* Eat content. */ | |
while (index < length) { | |
character = value.charAt(index); | |
content += closing; | |
exdentedContent += exdentedClosing; | |
closing = ''; | |
exdentedClosing = ''; | |
if (character !== C_NEWLINE) { | |
content += character; | |
exdentedClosing += character; | |
index++; | |
continue; | |
} | |
/* Add the newline to `subvalue` if its the first | |
* character. Otherwise, add it to the `closing` | |
* queue. */ | |
if (content) { | |
closing += character; | |
exdentedClosing += character; | |
} else { | |
subvalue += character; | |
} | |
queue = ''; | |
index++; | |
while (index < length) { | |
character = value.charAt(index); | |
if (character !== C_SPACE) { | |
break; | |
} | |
queue += character; | |
index++; | |
} | |
closing += queue; | |
exdentedClosing += queue.slice(indent); | |
if (queue.length >= CODE_INDENT_COUNT) { | |
continue; | |
} | |
queue = ''; | |
while (index < length) { | |
character = value.charAt(index); | |
if (character !== marker) { | |
break; | |
} | |
queue += character; | |
index++; | |
} | |
closing += queue; | |
exdentedClosing += queue; | |
if (queue.length < fenceCount) { | |
continue; | |
} | |
queue = ''; | |
while (index < length) { | |
character = value.charAt(index); | |
if (character !== C_SPACE && character !== C_TAB) { | |
break; | |
} | |
closing += character; | |
exdentedClosing += character; | |
index++; | |
} | |
if (!character || character === C_NEWLINE) { | |
break; | |
} | |
} | |
subvalue += content + closing; | |
return eat(subvalue)({ | |
type: 'code', | |
lang: flag || null, | |
value: trim(exdentedContent) | |
}); | |
} | |
},{"trim-trailing-lines":62}],20:[function(require,module,exports){ | |
'use strict'; | |
var repeat = require('repeat-string'); | |
var trim = require('trim-trailing-lines'); | |
module.exports = indentedCode; | |
var C_NEWLINE = '\n'; | |
var C_TAB = '\t'; | |
var C_SPACE = ' '; | |
var CODE_INDENT_COUNT = 4; | |
var CODE_INDENT = repeat(C_SPACE, CODE_INDENT_COUNT); | |
/* Tokenise indented code. */ | |
function indentedCode(eat, value, silent) { | |
var index = -1; | |
var length = value.length; | |
var subvalue = ''; | |
var content = ''; | |
var subvalueQueue = ''; | |
var contentQueue = ''; | |
var character; | |
var blankQueue; | |
var indent; | |
while (++index < length) { | |
character = value.charAt(index); | |
if (indent) { | |
indent = false; | |
subvalue += subvalueQueue; | |
content += contentQueue; | |
subvalueQueue = ''; | |
contentQueue = ''; | |
if (character === C_NEWLINE) { | |
subvalueQueue = character; | |
contentQueue = character; | |
} else { | |
subvalue += character; | |
content += character; | |
while (++index < length) { | |
character = value.charAt(index); | |
if (!character || character === C_NEWLINE) { | |
contentQueue = character; | |
subvalueQueue = character; | |
break; | |
} | |
subvalue += character; | |
content += character; | |
} | |
} | |
} else if ( | |
character === C_SPACE && | |
value.charAt(index + 1) === character && | |
value.charAt(index + 2) === character && | |
value.charAt(index + 3) === character | |
) { | |
subvalueQueue += CODE_INDENT; | |
index += 3; | |
indent = true; | |
} else if (character === C_TAB) { | |
subvalueQueue += character; | |
indent = true; | |
} else { | |
blankQueue = ''; | |
while (character === C_TAB || character === C_SPACE) { | |
blankQueue += character; | |
character = value.charAt(++index); | |
} | |
if (character !== C_NEWLINE) { | |
break; | |
} | |
subvalueQueue += blankQueue + character; | |
contentQueue += character; | |
} | |
} | |
if (content) { | |
if (silent) { | |
return true; | |
} | |
return eat(subvalue)({ | |
type: 'code', | |
lang: null, | |
value: trim(content) | |
}); | |
} | |
} | |
},{"repeat-string":60,"trim-trailing-lines":62}],21:[function(require,module,exports){ | |
'use strict'; | |
var whitespace = require('is-whitespace-character'); | |
var locate = require('../locate/code-inline'); | |
module.exports = inlineCode; | |
inlineCode.locator = locate; | |
var C_TICK = '`'; | |
/* Tokenise inline code. */ | |
function inlineCode(eat, value, silent) { | |
var length = value.length; | |
var index = 0; | |
var queue = ''; | |
var tickQueue = ''; | |
var contentQueue; | |
var subqueue; | |
var count; | |
var openingCount; | |
var subvalue; | |
var character; | |
var found; | |
var next; | |
while (index < length) { | |
if (value.charAt(index) !== C_TICK) { | |
break; | |
} | |
queue += C_TICK; | |
index++; | |
} | |
if (!queue) { | |
return; | |
} | |
subvalue = queue; | |
openingCount = index; | |
queue = ''; | |
next = value.charAt(index); | |
count = 0; | |
while (index < length) { | |
character = next; | |
next = value.charAt(index + 1); | |
if (character === C_TICK) { | |
count++; | |
tickQueue += character; | |
} else { | |
count = 0; | |
queue += character; | |
} | |
if (count && next !== C_TICK) { | |
if (count === openingCount) { | |
subvalue += queue + tickQueue; | |
found = true; | |
break; | |
} | |
queue += tickQueue; | |
tickQueue = ''; | |
} | |
index++; | |
} | |
if (!found) { | |
if (openingCount % 2 !== 0) { | |
return; | |
} | |
queue = ''; | |
} | |
/* istanbul ignore if - never used (yet) */ | |
if (silent) { | |
return true; | |
} | |
contentQueue = ''; | |
subqueue = ''; | |
length = queue.length; | |
index = -1; | |
while (++index < length) { | |
character = queue.charAt(index); | |
if (whitespace(character)) { | |
subqueue += character; | |
continue; | |
} | |
if (subqueue) { | |
if (contentQueue) { | |
contentQueue += subqueue; | |
} | |
subqueue = ''; | |
} | |
contentQueue += character; | |
} | |
return eat(subvalue)({ | |
type: 'inlineCode', | |
value: contentQueue | |
}); | |
} | |
},{"../locate/code-inline":5,"is-whitespace-character":51}],22:[function(require,module,exports){ | |
'use strict'; | |
var whitespace = require('is-whitespace-character'); | |
var normalize = require('../util/normalize'); | |
module.exports = definition; | |
definition.notInList = true; | |
definition.notInBlock = true; | |
var C_DOUBLE_QUOTE = '"'; | |
var C_SINGLE_QUOTE = '\''; | |
var C_BACKSLASH = '\\'; | |
var C_NEWLINE = '\n'; | |
var C_TAB = '\t'; | |
var C_SPACE = ' '; | |
var C_BRACKET_OPEN = '['; | |
var C_BRACKET_CLOSE = ']'; | |
var C_PAREN_OPEN = '('; | |
var C_PAREN_CLOSE = ')'; | |
var C_COLON = ':'; | |
var C_LT = '<'; | |
var C_GT = '>'; | |
function definition(eat, value, silent) { | |
var self = this; | |
var commonmark = self.options.commonmark; | |
var index = 0; | |
var length = value.length; | |
var subvalue = ''; | |
var beforeURL; | |
var beforeTitle; | |
var queue; | |
var character; | |
var test; | |
var identifier; | |
var url; | |
var title; | |
while (index < length) { | |
character = value.charAt(index); | |
if (character !== C_SPACE && character !== C_TAB) { | |
break; | |
} | |
subvalue += character; | |
index++; | |
} | |
character = value.charAt(index); | |
if (character !== C_BRACKET_OPEN) { | |
return; | |
} | |
index++; | |
subvalue += character; | |
queue = ''; | |
while (index < length) { | |
character = value.charAt(index); | |
if (character === C_BRACKET_CLOSE) { | |
break; | |
} else if (character === C_BACKSLASH) { | |
queue += character; | |
index++; | |
character = value.charAt(index); | |
} | |
queue += character; | |
index++; | |
} | |
if ( | |
!queue || | |
value.charAt(index) !== C_BRACKET_CLOSE || | |
value.charAt(index + 1) !== C_COLON | |
) { | |
return; | |
} | |
identifier = queue; | |
subvalue += queue + C_BRACKET_CLOSE + C_COLON; | |
index = subvalue.length; | |
queue = ''; | |
while (index < length) { | |
character = value.charAt(index); | |
if ( | |
character !== C_TAB && | |
character !== C_SPACE && | |
character !== C_NEWLINE | |
) { | |
break; | |
} | |
subvalue += character; | |
index++; | |
} | |
character = value.charAt(index); | |
queue = ''; | |
beforeURL = subvalue; | |
if (character === C_LT) { | |
index++; | |
while (index < length) { | |
character = value.charAt(index); | |
if (!isEnclosedURLCharacter(character)) { | |
break; | |
} | |
queue += character; | |
index++; | |
} | |
character = value.charAt(index); | |
if (character === isEnclosedURLCharacter.delimiter) { | |
subvalue += C_LT + queue + character; | |
index++; | |
} else { | |
if (commonmark) { | |
return; | |
} | |
index -= queue.length + 1; | |
queue = ''; | |
} | |
} | |
if (!queue) { | |
while (index < length) { | |
character = value.charAt(index); | |
if (!isUnclosedURLCharacter(character)) { | |
break; | |
} | |
queue += character; | |
index++; | |
} | |
subvalue += queue; | |
} | |
if (!queue) { | |
return; | |
} | |
url = queue; | |
queue = ''; | |
while (index < length) { | |
character = value.charAt(index); | |
if ( | |
character !== C_TAB && | |
character !== C_SPACE && | |
character !== C_NEWLINE | |
) { | |
break; | |
} | |
queue += character; | |
index++; | |
} | |
character = value.charAt(index); | |
test = null; | |
if (character === C_DOUBLE_QUOTE) { | |
test = C_DOUBLE_QUOTE; | |
} else if (character === C_SINGLE_QUOTE) { | |
test = C_SINGLE_QUOTE; | |
} else if (character === C_PAREN_OPEN) { | |
test = C_PAREN_CLOSE; | |
} | |
if (!test) { | |
queue = ''; | |
index = subvalue.length; | |
} else if (queue) { | |
subvalue += queue + character; | |
index = subvalue.length; | |
queue = ''; | |
while (index < length) { | |
character = value.charAt(index); | |
if (character === test) { | |
break; | |
} | |
if (character === C_NEWLINE) { | |
index++; | |
character = value.charAt(index); | |
if (character === C_NEWLINE || character === test) { | |
return; | |
} | |
queue += C_NEWLINE; | |
} | |
queue += character; | |
index++; | |
} | |
character = value.charAt(index); | |
if (character !== test) { | |
return; | |
} | |
beforeTitle = subvalue; | |
subvalue += queue + character; | |
index++; | |
title = queue; | |
queue = ''; | |
} else { | |
return; | |
} | |
while (index < length) { | |
character = value.charAt(index); | |
if (character !== C_TAB && character !== C_SPACE) { | |
break; | |
} | |
subvalue += character; | |
index++; | |
} | |
character = value.charAt(index); | |
if (!character || character === C_NEWLINE) { | |
if (silent) { | |
return true; | |
} | |
beforeURL = eat(beforeURL).test().end; | |
url = self.decode.raw(self.unescape(url), beforeURL); | |
if (title) { | |
beforeTitle = eat(beforeTitle).test().end; | |
title = self.decode.raw(self.unescape(title), beforeTitle); | |
} | |
return eat(subvalue)({ | |
type: 'definition', | |
identifier: normalize(identifier), | |
title: title || null, | |
url: url | |
}); | |
} | |
} | |
/* Check if `character` can be inside an enclosed URI. */ | |
function isEnclosedURLCharacter(character) { | |
return character !== C_GT && | |
character !== C_BRACKET_OPEN && | |
character !== C_BRACKET_CLOSE; | |
} | |
isEnclosedURLCharacter.delimiter = C_GT; | |
/* Check if `character` can be inside an unclosed URI. */ | |
function isUnclosedURLCharacter(character) { | |
return character !== C_BRACKET_OPEN && | |
character !== C_BRACKET_CLOSE && | |
!whitespace(character); | |
} | |
},{"../util/normalize":46,"is-whitespace-character":51}],23:[function(require,module,exports){ | |
'use strict'; | |
var whitespace = require('is-whitespace-character'); | |
var locate = require('../locate/delete'); | |
module.exports = strikethrough; | |
strikethrough.locator = locate; | |
var C_TILDE = '~'; | |
var DOUBLE = '~~'; | |
function strikethrough(eat, value, silent) { | |
var self = this; | |
var character = ''; | |
var previous = ''; | |
var preceding = ''; | |
var subvalue = ''; | |
var index; | |
var length; | |
var now; | |
if ( | |
!self.options.gfm || | |
value.charAt(0) !== C_TILDE || | |
value.charAt(1) !== C_TILDE || | |
whitespace(value.charAt(2)) | |
) { | |
return; | |
} | |
index = 1; | |
length = value.length; | |
now = eat.now(); | |
now.column += 2; | |
now.offset += 2; | |
while (++index < length) { | |
character = value.charAt(index); | |
if ( | |
character === C_TILDE && | |
previous === C_TILDE && | |
(!preceding || !whitespace(preceding)) | |
) { | |
/* istanbul ignore if - never used (yet) */ | |
if (silent) { | |
return true; | |
} | |
return eat(DOUBLE + subvalue + DOUBLE)({ | |
type: 'delete', | |
children: self.tokenizeInline(subvalue, now) | |
}); | |
} | |
subvalue += previous; | |
preceding = previous; | |
previous = character; | |
} | |
} | |
},{"../locate/delete":6,"is-whitespace-character":51}],24:[function(require,module,exports){ | |
'use strict'; | |
var trim = require('trim'); | |
var word = require('is-word-character'); | |
var whitespace = require('is-whitespace-character'); | |
var locate = require('../locate/emphasis'); | |
module.exports = emphasis; | |
emphasis.locator = locate; | |
var C_ASTERISK = '*'; | |
var C_UNDERSCORE = '_'; | |
function emphasis(eat, value, silent) { | |
var self = this; | |
var index = 0; | |
var character = value.charAt(index); | |
var now; | |
var pedantic; | |
var marker; | |
var queue; | |
var subvalue; | |
var length; | |
var prev; | |
if (character !== C_ASTERISK && character !== C_UNDERSCORE) { | |
return; | |
} | |
pedantic = self.options.pedantic; | |
subvalue = character; | |
marker = character; | |
length = value.length; | |
index++; | |
queue = ''; | |
character = ''; | |
if (pedantic && whitespace(value.charAt(index))) { | |
return; | |
} | |
while (index < length) { | |
prev = character; | |
character = value.charAt(index); | |
if (character === marker && (!pedantic || !whitespace(prev))) { | |
character = value.charAt(++index); | |
if (character !== marker) { | |
if (!trim(queue) || prev === marker) { | |
return; | |
} | |
if (!pedantic && marker === C_UNDERSCORE && word(character)) { | |
queue += marker; | |
continue; | |
} | |
/* istanbul ignore if - never used (yet) */ | |
if (silent) { | |
return true; | |
} | |
now = eat.now(); | |
now.column++; | |
now.offset++; | |
return eat(subvalue + queue + marker)({ | |
type: 'emphasis', | |
children: self.tokenizeInline(queue, now) | |
}); | |
} | |
queue += marker; | |
} | |
if (!pedantic && character === '\\') { | |
queue += character; | |
character = value.charAt(++index); | |
} | |
queue += character; | |
index++; | |
} | |
} | |
},{"../locate/emphasis":7,"is-whitespace-character":51,"is-word-character":52,"trim":63}],25:[function(require,module,exports){ | |
'use strict'; | |
var locate = require('../locate/escape'); | |
module.exports = escape; | |
escape.locator = locate; | |
function escape(eat, value, silent) { | |
var self = this; | |
var character; | |
var node; | |
if (value.charAt(0) === '\\') { | |
character = value.charAt(1); | |
if (self.escape.indexOf(character) !== -1) { | |
/* istanbul ignore if - never used (yet) */ | |
if (silent) { | |
return true; | |
} | |
if (character === '\n') { | |
node = {type: 'break'}; | |
} else { | |
node = { | |
type: 'text', | |
value: character | |
}; | |
} | |
return eat('\\' + character)(node); | |
} | |
} | |
} | |
},{"../locate/escape":8}],26:[function(require,module,exports){ | |
'use strict'; | |
var whitespace = require('is-whitespace-character'); | |
var normalize = require('../util/normalize'); | |
module.exports = footnoteDefinition; | |
footnoteDefinition.notInList = true; | |
footnoteDefinition.notInBlock = true; | |
var C_BACKSLASH = '\\'; | |
var C_NEWLINE = '\n'; | |
var C_TAB = '\t'; | |
var C_SPACE = ' '; | |
var C_BRACKET_OPEN = '['; | |
var C_BRACKET_CLOSE = ']'; | |
var C_CARET = '^'; | |
var C_COLON = ':'; | |
var EXPRESSION_INITIAL_TAB = /^( {4}|\t)?/gm; | |
function footnoteDefinition(eat, value, silent) { | |
var self = this; | |
var offsets = self.offset; | |
var index; | |
var length; | |
var subvalue; | |
var now; | |
var currentLine; | |
var content; | |
var queue; | |
var subqueue; | |
var character; | |
var identifier; | |
var add; | |
var exit; | |
if (!self.options.footnotes) { | |
return; | |
} | |
index = 0; | |
length = value.length; | |
subvalue = ''; | |
now = eat.now(); | |
currentLine = now.line; | |
while (index < length) { | |
character = value.charAt(index); | |
if (!whitespace(character)) { | |
break; | |
} | |
subvalue += character; | |
index++; | |
} | |
if ( | |
value.charAt(index) !== C_BRACKET_OPEN || | |
value.charAt(index + 1) !== C_CARET | |
) { | |
return; | |
} | |
subvalue += C_BRACKET_OPEN + C_CARET; | |
index = subvalue.length; | |
queue = ''; | |
while (index < length) { | |
character = value.charAt(index); | |
if (character === C_BRACKET_CLOSE) { | |
break; | |
} else if (character === C_BACKSLASH) { | |
queue += character; | |
index++; | |
character = value.charAt(index); | |
} | |
queue += character; | |
index++; | |
} | |
if ( | |
!queue || | |
value.charAt(index) !== C_BRACKET_CLOSE || | |
value.charAt(index + 1) !== C_COLON | |
) { | |
return; | |
} | |
if (silent) { | |
return true; | |
} | |
identifier = normalize(queue); | |
subvalue += queue + C_BRACKET_CLOSE + C_COLON; | |
index = subvalue.length; | |
while (index < length) { | |
character = value.charAt(index); | |
if (character !== C_TAB && character !== C_SPACE) { | |
break; | |
} | |
subvalue += character; | |
index++; | |
} | |
now.column += subvalue.length; | |
now.offset += subvalue.length; | |
queue = ''; | |
content = ''; | |
subqueue = ''; | |
while (index < length) { | |
character = value.charAt(index); | |
if (character === C_NEWLINE) { | |
subqueue = character; | |
index++; | |
while (index < length) { | |
character = value.charAt(index); | |
if (character !== C_NEWLINE) { | |
break; | |
} | |
subqueue += character; | |
index++; | |
} | |
queue += subqueue; | |
subqueue = ''; | |
while (index < length) { | |
character = value.charAt(index); | |
if (character !== C_SPACE) { | |
break; | |
} | |
subqueue += character; | |
index++; | |
} | |
if (subqueue.length === 0) { | |
break; | |
} | |
queue += subqueue; | |
} | |
if (queue) { | |
content += queue; | |
queue = ''; | |
} | |
content += character; | |
index++; | |
} | |
subvalue += content; | |
content = content.replace(EXPRESSION_INITIAL_TAB, function (line) { | |
offsets[currentLine] = (offsets[currentLine] || 0) + line.length; | |
currentLine++; | |
return ''; | |
}); | |
add = eat(subvalue); | |
exit = self.enterBlock(); | |
content = self.tokenizeBlock(content, now); | |
exit(); | |
return add({ | |
type: 'footnoteDefinition', | |
identifier: identifier, | |
children: content | |
}); | |
} | |
},{"../util/normalize":46,"is-whitespace-character":51}],27:[function(require,module,exports){ | |
'use strict'; | |
module.exports = atxHeading; | |
var C_NEWLINE = '\n'; | |
var C_TAB = '\t'; | |
var C_SPACE = ' '; | |
var C_HASH = '#'; | |
var MAX_ATX_COUNT = 6; | |
function atxHeading(eat, value, silent) { | |
var self = this; | |
var settings = self.options; | |
var length = value.length + 1; | |
var index = -1; | |
var now = eat.now(); | |
var subvalue = ''; | |
var content = ''; | |
var character; | |
var queue; | |
var depth; | |
/* Eat initial spacing. */ | |
while (++index < length) { | |
character = value.charAt(index); | |
if (character !== C_SPACE && character !== C_TAB) { | |
index--; | |
break; | |
} | |
subvalue += character; | |
} | |
/* Eat hashes. */ | |
depth = 0; | |
while (++index <= length) { | |
character = value.charAt(index); | |
if (character !== C_HASH) { | |
index--; | |
break; | |
} | |
subvalue += character; | |
depth++; | |
} | |
if (depth > MAX_ATX_COUNT) { | |
return; | |
} | |
if ( | |
!depth || | |
(!settings.pedantic && value.charAt(index + 1) === C_HASH) | |
) { | |
return; | |
} | |
length = value.length + 1; | |
/* Eat intermediate white-space. */ | |
queue = ''; | |
while (++index < length) { | |
character = value.charAt(index); | |
if (character !== C_SPACE && character !== C_TAB) { | |
index--; | |
break; | |
} | |
queue += character; | |
} | |
/* Exit when not in pedantic mode without spacing. */ | |
if ( | |
!settings.pedantic && | |
queue.length === 0 && | |
character && | |
character !== C_NEWLINE | |
) { | |
return; | |
} | |
if (silent) { | |
return true; | |
} | |
/* Eat content. */ | |
subvalue += queue; | |
queue = ''; | |
content = ''; | |
while (++index < length) { | |
character = value.charAt(index); | |
if (!character || character === C_NEWLINE) { | |
break; | |
} | |
if ( | |
character !== C_SPACE && | |
character !== C_TAB && | |
character !== C_HASH | |
) { | |
content += queue + character; | |
queue = ''; | |
continue; | |
} | |
while (character === C_SPACE || character === C_TAB) { | |
queue += character; | |
character = value.charAt(++index); | |
} | |
while (character === C_HASH) { | |
queue += character; | |
character = value.charAt(++index); | |
} | |
while (character === C_SPACE || character === C_TAB) { | |
queue += character; | |
character = value.charAt(++index); | |
} | |
index--; | |
} | |
now.column += subvalue.length; | |
now.offset += subvalue.length; | |
subvalue += content + queue; | |
return eat(subvalue)({ | |
type: 'heading', | |
depth: depth, | |
children: self.tokenizeInline(content, now) | |
}); | |
} | |
},{}],28:[function(require,module,exports){ | |
'use strict'; | |
module.exports = setextHeading; | |
var C_NEWLINE = '\n'; | |
var C_TAB = '\t'; | |
var C_SPACE = ' '; | |
var C_EQUALS = '='; | |
var C_DASH = '-'; | |
var MAX_HEADING_INDENT = 3; | |
/* Map of characters which can be used to mark setext | |
* headers, mapping to their corresponding depth. */ | |
var SETEXT_MARKERS = {}; | |
SETEXT_MARKERS[C_EQUALS] = 1; | |
SETEXT_MARKERS[C_DASH] = 2; | |
function setextHeading(eat, value, silent) { | |
var self = this; | |
var now = eat.now(); | |
var length = value.length; | |
var index = -1; | |
var subvalue = ''; | |
var content; | |
var queue; | |
var character; | |
var marker; | |
var depth; | |
/* Eat initial indentation. */ | |
while (++index < length) { | |
character = value.charAt(index); | |
if (character !== C_SPACE || index >= MAX_HEADING_INDENT) { | |
index--; | |
break; | |
} | |
subvalue += character; | |
} | |
/* Eat content. */ | |
content = ''; | |
queue = ''; | |
while (++index < length) { | |
character = value.charAt(index); | |
if (character === C_NEWLINE) { | |
index--; | |
break; | |
} | |
if (character === C_SPACE || character === C_TAB) { | |
queue += character; | |
} else { | |
content += queue + character; | |
queue = ''; | |
} | |
} | |
now.column += subvalue.length; | |
now.offset += subvalue.length; | |
subvalue += content + queue; | |
/* Ensure the content is followed by a newline and a | |
* valid marker. */ | |
character = value.charAt(++index); | |
marker = value.charAt(++index); | |
if (character !== C_NEWLINE || !SETEXT_MARKERS[marker]) { | |
return; | |
} | |
subvalue += character; | |
/* Eat Setext-line. */ | |
queue = marker; | |
depth = SETEXT_MARKERS[marker]; | |
while (++index < length) { | |
character = value.charAt(index); | |
if (character !== marker) { | |
if (character !== C_NEWLINE) { | |
return; | |
} | |
index--; | |
break; | |
} | |
queue += character; | |
} | |
if (silent) { | |
return true; | |
} | |
return eat(subvalue + queue)({ | |
type: 'heading', | |
depth: depth, | |
children: self.tokenizeInline(content, now) | |
}); | |
} | |
},{}],29:[function(require,module,exports){ | |
'use strict'; | |
var openCloseTag = require('../util/html').openCloseTag; | |
module.exports = blockHTML; | |
var C_TAB = '\t'; | |
var C_SPACE = ' '; | |
var C_NEWLINE = '\n'; | |
var C_LT = '<'; | |
function blockHTML(eat, value, silent) { | |
var self = this; | |
var blocks = self.options.blocks; | |
var length = value.length; | |
var index = 0; | |
var next; | |
var line; | |
var offset; | |
var character; | |
var count; | |
var sequence; | |
var subvalue; | |
var sequences = [ | |
[/^<(script|pre|style)(?=(\s|>|$))/i, /<\/(script|pre|style)>/i, true], | |
[/^<!--/, /-->/, true], | |
[/^<\?/, /\?>/, true], | |
[/^<![A-Za-z]/, />/, true], | |
[/^<!\[CDATA\[/, /\]\]>/, true], | |
[new RegExp('^</?(' + blocks.join('|') + ')(?=(\\s|/?>|$))', 'i'), /^$/, true], | |
[new RegExp(openCloseTag.source + '\\s*$'), /^$/, false] | |
]; | |
/* Eat initial spacing. */ | |
while (index < length) { | |
character = value.charAt(index); | |
if (character !== C_TAB && character !== C_SPACE) { | |
break; | |
} | |
index++; | |
} | |
if (value.charAt(index) !== C_LT) { | |
return; | |
} | |
next = value.indexOf(C_NEWLINE, index + 1); | |
next = next === -1 ? length : next; | |
line = value.slice(index, next); | |
offset = -1; | |
count = sequences.length; | |
while (++offset < count) { | |
if (sequences[offset][0].test(line)) { | |
sequence = sequences[offset]; | |
break; | |
} | |
} | |
if (!sequence) { | |
return; | |
} | |
if (silent) { | |
return sequence[2]; | |
} | |
index = next; | |
if (!sequence[1].test(line)) { | |
while (index < length) { | |
next = value.indexOf(C_NEWLINE, index + 1); | |
next = next === -1 ? length : next; | |
line = value.slice(index + 1, next); | |
if (sequence[1].test(line)) { | |
if (line) { | |
index = next; | |
} | |
break; | |
} | |
index = next; | |
} | |
} | |
subvalue = value.slice(0, index); | |
return eat(subvalue)({type: 'html', value: subvalue}); | |
} | |
},{"../util/html":44}],30:[function(require,module,exports){ | |
'use strict'; | |
var alphabetical = require('is-alphabetical'); | |
var locate = require('../locate/tag'); | |
var tag = require('../util/html').tag; | |
module.exports = inlineHTML; | |
inlineHTML.locator = locate; | |
var EXPRESSION_HTML_LINK_OPEN = /^<a /i; | |
var EXPRESSION_HTML_LINK_CLOSE = /^<\/a>/i; | |
function inlineHTML(eat, value, silent) { | |
var self = this; | |
var length = value.length; | |
var character; | |
var subvalue; | |
if (value.charAt(0) !== '<' || length < 3) { | |
return; | |
} | |
character = value.charAt(1); | |
if ( | |
!alphabetical(character) && | |
character !== '?' && | |
character !== '!' && | |
character !== '/' | |
) { | |
return; | |
} | |
subvalue = value.match(tag); | |
if (!subvalue) { | |
return; | |
} | |
/* istanbul ignore if - not used yet. */ | |
if (silent) { | |
return true; | |
} | |
subvalue = subvalue[0]; | |
if (!self.inLink && EXPRESSION_HTML_LINK_OPEN.test(subvalue)) { | |
self.inLink = true; | |
} else if (self.inLink && EXPRESSION_HTML_LINK_CLOSE.test(subvalue)) { | |
self.inLink = false; | |
} | |
return eat(subvalue)({type: 'html', value: subvalue}); | |
} | |
},{"../locate/tag":11,"../util/html":44,"is-alphabetical":49}],31:[function(require,module,exports){ | |
'use strict'; | |
var whitespace = require('is-whitespace-character'); | |
var locate = require('../locate/link'); | |
module.exports = link; | |
link.locator = locate; | |
var own = {}.hasOwnProperty; | |
var C_BACKSLASH = '\\'; | |
var C_BRACKET_OPEN = '['; | |
var C_BRACKET_CLOSE = ']'; | |
var C_PAREN_OPEN = '('; | |
var C_PAREN_CLOSE = ')'; | |
var C_LT = '<'; | |
var C_GT = '>'; | |
var C_TICK = '`'; | |
var C_DOUBLE_QUOTE = '"'; | |
var C_SINGLE_QUOTE = '\''; | |
/* Map of characters, which can be used to mark link | |
* and image titles. */ | |
var LINK_MARKERS = {}; | |
LINK_MARKERS[C_DOUBLE_QUOTE] = C_DOUBLE_QUOTE; | |
LINK_MARKERS[C_SINGLE_QUOTE] = C_SINGLE_QUOTE; | |
/* Map of characters, which can be used to mark link | |
* and image titles in commonmark-mode. */ | |
var COMMONMARK_LINK_MARKERS = {}; | |
COMMONMARK_LINK_MARKERS[C_DOUBLE_QUOTE] = C_DOUBLE_QUOTE; | |
COMMONMARK_LINK_MARKERS[C_SINGLE_QUOTE] = C_SINGLE_QUOTE; | |
COMMONMARK_LINK_MARKERS[C_PAREN_OPEN] = C_PAREN_CLOSE; | |
function link(eat, value, silent) { | |
var self = this; | |
var subvalue = ''; | |
var index = 0; | |
var character = value.charAt(0); | |
var pedantic = self.options.pedantic; | |
var commonmark = self.options.commonmark; | |
var gfm = self.options.gfm; | |
var closed; | |
var count; | |
var opening; | |
var beforeURL; | |
var beforeTitle; | |
var subqueue; | |
var hasMarker; | |
var markers; | |
var isImage; | |
var content; | |
var marker; | |
var length; | |
var title; | |
var depth; | |
var queue; | |
var url; | |
var now; | |
var exit; | |
var node; | |
/* Detect whether this is an image. */ | |
if (character === '!') { | |
isImage = true; | |
subvalue = character; | |
character = value.charAt(++index); | |
} | |
/* Eat the opening. */ | |
if (character !== C_BRACKET_OPEN) { | |
return; | |
} | |
/* Exit when this is a link and we’re already inside | |
* a link. */ | |
if (!isImage && self.inLink) { | |
return; | |
} | |
subvalue += character; | |
queue = ''; | |
index++; | |
/* Eat the content. */ | |
length = value.length; | |
now = eat.now(); | |
depth = 0; | |
now.column += index; | |
now.offset += index; | |
while (index < length) { | |
character = value.charAt(index); | |
subqueue = character; | |
if (character === C_TICK) { | |
/* Inline-code in link content. */ | |
count = 1; | |
while (value.charAt(index + 1) === C_TICK) { | |
subqueue += character; | |
index++; | |
count++; | |
} | |
if (!opening) { | |
opening = count; | |
} else if (count >= opening) { | |
opening = 0; | |
} | |
} else if (character === C_BACKSLASH) { | |
/* Allow brackets to be escaped. */ | |
index++; | |
subqueue += value.charAt(index); | |
/* In GFM mode, brackets in code still count. | |
* In all other modes, they don’t. This empty | |
* block prevents the next statements are | |
* entered. */ | |
} else if ((!opening || gfm) && character === C_BRACKET_OPEN) { | |
depth++; | |
} else if ((!opening || gfm) && character === C_BRACKET_CLOSE) { | |
if (depth) { | |
depth--; | |
} else { | |
/* Allow white-space between content and | |
* url in GFM mode. */ | |
if (!pedantic) { | |
while (index < length) { | |
character = value.charAt(index + 1); | |
if (!whitespace(character)) { | |
break; | |
} | |
subqueue += character; | |
index++; | |
} | |
} | |
if (value.charAt(index + 1) !== C_PAREN_OPEN) { | |
return; | |
} | |
subqueue += C_PAREN_OPEN; | |
closed = true; | |
index++; | |
break; | |
} | |
} | |
queue += subqueue; | |
subqueue = ''; | |
index++; | |
} | |
/* Eat the content closing. */ | |
if (!closed) { | |
return; | |
} | |
content = queue; | |
subvalue += queue + subqueue; | |
index++; | |
/* Eat white-space. */ | |
while (index < length) { | |
character = value.charAt(index); | |
if (!whitespace(character)) { | |
break; | |
} | |
subvalue += character; | |
index++; | |
} | |
/* Eat the URL. */ | |
character = value.charAt(index); | |
markers = commonmark ? COMMONMARK_LINK_MARKERS : LINK_MARKERS; | |
queue = ''; | |
beforeURL = subvalue; | |
if (character === C_LT) { | |
index++; | |
beforeURL += C_LT; | |
while (index < length) { | |
character = value.charAt(index); | |
if (character === C_GT) { | |
break; | |
} | |
if (commonmark && character === '\n') { | |
return; | |
} | |
queue += character; | |
index++; | |
} | |
if (value.charAt(index) !== C_GT) { | |
return; | |
} | |
subvalue += C_LT + queue + C_GT; | |
url = queue; | |
index++; | |
} else { | |
character = null; | |
subqueue = ''; | |
while (index < length) { | |
character = value.charAt(index); | |
if (subqueue && own.call(markers, character)) { | |
break; | |
} | |
if (whitespace(character)) { | |
if (!pedantic) { | |
break; | |
} | |
subqueue += character; | |
} else { | |
if (character === C_PAREN_OPEN) { | |
depth++; | |
} else if (character === C_PAREN_CLOSE) { | |
if (depth === 0) { | |
break; | |
} | |
depth--; | |
} | |
queue += subqueue; | |
subqueue = ''; | |
if (character === C_BACKSLASH) { | |
queue += C_BACKSLASH; | |
character = value.charAt(++index); | |
} | |
queue += character; | |
} | |
index++; | |
} | |
subvalue += queue; | |
url = queue; | |
index = subvalue.length; | |
} | |
/* Eat white-space. */ | |
queue = ''; | |
while (index < length) { | |
character = value.charAt(index); | |
if (!whitespace(character)) { | |
break; | |
} | |
queue += character; | |
index++; | |
} | |
character = value.charAt(index); | |
subvalue += queue; | |
/* Eat the title. */ | |
if (queue && own.call(markers, character)) { | |
index++; | |
subvalue += character; | |
queue = ''; | |
marker = markers[character]; | |
beforeTitle = subvalue; | |
/* In commonmark-mode, things are pretty easy: the | |
* marker cannot occur inside the title. | |
* | |
* Non-commonmark does, however, support nested | |
* delimiters. */ | |
if (commonmark) { | |
while (index < length) { | |
character = value.charAt(index); | |
if (character === marker) { | |
break; | |
} | |
if (character === C_BACKSLASH) { | |
queue += C_BACKSLASH; | |
character = value.charAt(++index); | |
} | |
index++; | |
queue += character; | |
} | |
character = value.charAt(index); | |
if (character !== marker) { | |
return; | |
} | |
title = queue; | |
subvalue += queue + character; | |
index++; | |
while (index < length) { | |
character = value.charAt(index); | |
if (!whitespace(character)) { | |
break; | |
} | |
subvalue += character; | |
index++; | |
} | |
} else { | |
subqueue = ''; | |
while (index < length) { | |
character = value.charAt(index); | |
if (character === marker) { | |
if (hasMarker) { | |
queue += marker + subqueue; | |
subqueue = ''; | |
} | |
hasMarker = true; | |
} else if (!hasMarker) { | |
queue += character; | |
} else if (character === C_PAREN_CLOSE) { | |
subvalue += queue + marker + subqueue; | |
title = queue; | |
break; | |
} else if (whitespace(character)) { | |
subqueue += character; | |
} else { | |
queue += marker + subqueue + character; | |
subqueue = ''; | |
hasMarker = false; | |
} | |
index++; | |
} | |
} | |
} | |
if (value.charAt(index) !== C_PAREN_CLOSE) { | |
return; | |
} | |
/* istanbul ignore if - never used (yet) */ | |
if (silent) { | |
return true; | |
} | |
subvalue += C_PAREN_CLOSE; | |
url = self.decode.raw(self.unescape(url), eat(beforeURL).test().end); | |
if (title) { | |
beforeTitle = eat(beforeTitle).test().end; | |
title = self.decode.raw(self.unescape(title), beforeTitle); | |
} | |
node = { | |
type: isImage ? 'image' : 'link', | |
title: title || null, | |
url: url | |
}; | |
if (isImage) { | |
node.alt = self.decode.raw(self.unescape(content), now) || null; | |
} else { | |
exit = self.enterLink(); | |
node.children = self.tokenizeInline(content, now); | |
exit(); | |
} | |
return eat(subvalue)(node); | |
} | |
},{"../locate/link":9,"is-whitespace-character":51}],32:[function(require,module,exports){ | |
'use strict'; | |
/* eslint-disable max-params */ | |
var trim = require('trim'); | |
var repeat = require('repeat-string'); | |
var decimal = require('is-decimal'); | |
var getIndent = require('../util/get-indentation'); | |
var removeIndent = require('../util/remove-indentation'); | |
var interrupt = require('../util/interrupt'); | |
module.exports = list; | |
var C_ASTERISK = '*'; | |
var C_UNDERSCORE = '_'; | |
var C_PLUS = '+'; | |
var C_DASH = '-'; | |
var C_DOT = '.'; | |
var C_SPACE = ' '; | |
var C_NEWLINE = '\n'; | |
var C_TAB = '\t'; | |
var C_PAREN_CLOSE = ')'; | |
var C_X_LOWER = 'x'; | |
var TAB_SIZE = 4; | |
var EXPRESSION_LOOSE_LIST_ITEM = /\n\n(?!\s*$)/; | |
var EXPRESSION_TASK_ITEM = /^\[([ \t]|x|X)][ \t]/; | |
var EXPRESSION_BULLET = /^([ \t]*)([*+-]|\d+[.)])( {1,4}(?! )| |\t|$|(?=\n))([^\n]*)/; | |
var EXPRESSION_PEDANTIC_BULLET = /^([ \t]*)([*+-]|\d+[.)])([ \t]+)/; | |
var EXPRESSION_INITIAL_INDENT = /^( {1,4}|\t)?/gm; | |
/* Map of characters which can be used to mark | |
* list-items. */ | |
var LIST_UNORDERED_MARKERS = {}; | |
LIST_UNORDERED_MARKERS[C_ASTERISK] = true; | |
LIST_UNORDERED_MARKERS[C_PLUS] = true; | |
LIST_UNORDERED_MARKERS[C_DASH] = true; | |
/* Map of characters which can be used to mark | |
* list-items after a digit. */ | |
var LIST_ORDERED_MARKERS = {}; | |
LIST_ORDERED_MARKERS[C_DOT] = true; | |
/* Map of characters which can be used to mark | |
* list-items after a digit. */ | |
var LIST_ORDERED_COMMONMARK_MARKERS = {}; | |
LIST_ORDERED_COMMONMARK_MARKERS[C_DOT] = true; | |
LIST_ORDERED_COMMONMARK_MARKERS[C_PAREN_CLOSE] = true; | |
function list(eat, value, silent) { | |
var self = this; | |
var commonmark = self.options.commonmark; | |
var pedantic = self.options.pedantic; | |
var tokenizers = self.blockTokenizers; | |
var interuptors = self.interruptList; | |
var markers; | |
var index = 0; | |
var length = value.length; | |
var start = null; | |
var size = 0; | |
var queue; | |
var ordered; | |
var character; | |
var marker; | |
var nextIndex; | |
var startIndex; | |
var prefixed; | |
var currentMarker; | |
var content; | |
var line; | |
var prevEmpty; | |
var empty; | |
var items; | |
var allLines; | |
var emptyLines; | |
var item; | |
var enterTop; | |
var exitBlockquote; | |
var isLoose; | |
var node; | |
var now; | |
var end; | |
var indented; | |
while (index < length) { | |
character = value.charAt(index); | |
if (character === C_TAB) { | |
size += TAB_SIZE - (size % TAB_SIZE); | |
} else if (character === C_SPACE) { | |
size++; | |
} else { | |
break; | |
} | |
index++; | |
} | |
if (size >= TAB_SIZE) { | |
return; | |
} | |
character = value.charAt(index); | |
markers = commonmark ? | |
LIST_ORDERED_COMMONMARK_MARKERS : | |
LIST_ORDERED_MARKERS; | |
if (LIST_UNORDERED_MARKERS[character] === true) { | |
marker = character; | |
ordered = false; | |
} else { | |
ordered = true; | |
queue = ''; | |
while (index < length) { | |
character = value.charAt(index); | |
if (!decimal(character)) { | |
break; | |
} | |
queue += character; | |
index++; | |
} | |
character = value.charAt(index); | |
if (!queue || markers[character] !== true) { | |
return; | |
} | |
start = parseInt(queue, 10); | |
marker = character; | |
} | |
character = value.charAt(++index); | |
if (character !== C_SPACE && character !== C_TAB) { | |
return; | |
} | |
if (silent) { | |
return true; | |
} | |
index = 0; | |
items = []; | |
allLines = []; | |
emptyLines = []; | |
while (index < length) { | |
nextIndex = value.indexOf(C_NEWLINE, index); | |
startIndex = index; | |
prefixed = false; | |
indented = false; | |
if (nextIndex === -1) { | |
nextIndex = length; | |
} | |
end = index + TAB_SIZE; | |
size = 0; | |
while (index < length) { | |
character = value.charAt(index); | |
if (character === C_TAB) { | |
size += TAB_SIZE - (size % TAB_SIZE); | |
} else if (character === C_SPACE) { | |
size++; | |
} else { | |
break; | |
} | |
index++; | |
} | |
if (size >= TAB_SIZE) { | |
indented = true; | |
} | |
if (item && size >= item.indent) { | |
indented = true; | |
} | |
character = value.charAt(index); | |
currentMarker = null; | |
if (!indented) { | |
if (LIST_UNORDERED_MARKERS[character] === true) { | |
currentMarker = character; | |
index++; | |
size++; | |
} else { | |
queue = ''; | |
while (index < length) { | |
character = value.charAt(index); | |
if (!decimal(character)) { | |
break; | |
} | |
queue += character; | |
index++; | |
} | |
character = value.charAt(index); | |
index++; | |
if (queue && markers[character] === true) { | |
currentMarker = character; | |
size += queue.length + 1; | |
} | |
} | |
if (currentMarker) { | |
character = value.charAt(index); | |
if (character === C_TAB) { | |
size += TAB_SIZE - (size % TAB_SIZE); | |
index++; | |
} else if (character === C_SPACE) { | |
end = index + TAB_SIZE; | |
while (index < end) { | |
if (value.charAt(index) !== C_SPACE) { | |
break; | |
} | |
index++; | |
size++; | |
} | |
if (index === end && value.charAt(index) === C_SPACE) { | |
index -= TAB_SIZE - 1; | |
size -= TAB_SIZE - 1; | |
} | |
} else if (character !== C_NEWLINE && character !== '') { | |
currentMarker = null; | |
} | |
} | |
} | |
if (currentMarker) { | |
if (!pedantic && marker !== currentMarker) { | |
break; | |
} | |
prefixed = true; | |
} else { | |
if (!commonmark && !indented && value.charAt(startIndex) === C_SPACE) { | |
indented = true; | |
} else if (commonmark && item) { | |
indented = size >= item.indent || size > TAB_SIZE; | |
} | |
prefixed = false; | |
index = startIndex; | |
} | |
line = value.slice(startIndex, nextIndex); | |
content = startIndex === index ? line : value.slice(index, nextIndex); | |
if ( | |
currentMarker === C_ASTERISK || | |
currentMarker === C_UNDERSCORE || | |
currentMarker === C_DASH | |
) { | |
if (tokenizers.thematicBreak.call(self, eat, line, true)) { | |
break; | |
} | |
} | |
prevEmpty = empty; | |
empty = !trim(content).length; | |
if (indented && item) { | |
item.value = item.value.concat(emptyLines, line); | |
allLines = allLines.concat(emptyLines, line); | |
emptyLines = []; | |
} else if (prefixed) { | |
if (emptyLines.length !== 0) { | |
item.value.push(''); | |
item.trail = emptyLines.concat(); | |
} | |
item = { | |
value: [line], | |
indent: size, | |
trail: [] | |
}; | |
items.push(item); | |
allLines = allLines.concat(emptyLines, line); | |
emptyLines = []; | |
} else if (empty) { | |
if (prevEmpty) { | |
break; | |
} | |
emptyLines.push(line); | |
} else { | |
if (prevEmpty) { | |
break; | |
} | |
if (interrupt(interuptors, tokenizers, self, [eat, line, true])) { | |
break; | |
} | |
item.value = item.value.concat(emptyLines, line); | |
allLines = allLines.concat(emptyLines, line); | |
emptyLines = []; | |
} | |
index = nextIndex + 1; | |
} | |
node = eat(allLines.join(C_NEWLINE)).reset({ | |
type: 'list', | |
ordered: ordered, | |
start: start, | |
loose: null, | |
children: [] | |
}); | |
enterTop = self.enterList(); | |
exitBlockquote = self.enterBlock(); | |
isLoose = false; | |
index = -1; | |
length = items.length; | |
while (++index < length) { | |
item = items[index].value.join(C_NEWLINE); | |
now = eat.now(); | |
item = eat(item)(listItem(self, item, now), node); | |
if (item.loose) { | |
isLoose = true; | |
} | |
item = items[index].trail.join(C_NEWLINE); | |
if (index !== length - 1) { | |
item += C_NEWLINE; | |
} | |
eat(item); | |
} | |
enterTop(); | |
exitBlockquote(); | |
node.loose = isLoose; | |
return node; | |
} | |
function listItem(ctx, value, position) { | |
var offsets = ctx.offset; | |
var fn = ctx.options.pedantic ? pedanticListItem : normalListItem; | |
var checked = null; | |
var task; | |
var indent; | |
value = fn.apply(null, arguments); | |
if (ctx.options.gfm) { | |
task = value.match(EXPRESSION_TASK_ITEM); | |
if (task) { | |
indent = task[0].length; | |
checked = task[1].toLowerCase() === C_X_LOWER; | |
offsets[position.line] += indent; | |
value = value.slice(indent); | |
} | |
} | |
return { | |
type: 'listItem', | |
loose: EXPRESSION_LOOSE_LIST_ITEM.test(value) || | |
value.charAt(value.length - 1) === C_NEWLINE, | |
checked: checked, | |
children: ctx.tokenizeBlock(value, position) | |
}; | |
} | |
/* Create a list-item using overly simple mechanics. */ | |
function pedanticListItem(ctx, value, position) { | |
var offsets = ctx.offset; | |
var line = position.line; | |
/* Remove the list-item’s bullet. */ | |
value = value.replace(EXPRESSION_PEDANTIC_BULLET, replacer); | |
/* The initial line was also matched by the below, so | |
* we reset the `line`. */ | |
line = position.line; | |
return value.replace(EXPRESSION_INITIAL_INDENT, replacer); | |
/* A simple replacer which removed all matches, | |
* and adds their length to `offset`. */ | |
function replacer($0) { | |
offsets[line] = (offsets[line] || 0) + $0.length; | |
line++; | |
return ''; | |
} | |
} | |
/* Create a list-item using sane mechanics. */ | |
function normalListItem(ctx, value, position) { | |
var offsets = ctx.offset; | |
var line = position.line; | |
var max; | |
var bullet; | |
var rest; | |
var lines; | |
var trimmedLines; | |
var index; | |
var length; | |
/* Remove the list-item’s bullet. */ | |
value = value.replace(EXPRESSION_BULLET, replacer); | |
lines = value.split(C_NEWLINE); | |
trimmedLines = removeIndent(value, getIndent(max).indent).split(C_NEWLINE); | |
/* We replaced the initial bullet with something | |
* else above, which was used to trick | |
* `removeIndentation` into removing some more | |
* characters when possible. However, that could | |
* result in the initial line to be stripped more | |
* than it should be. */ | |
trimmedLines[0] = rest; | |
offsets[line] = (offsets[line] || 0) + bullet.length; | |
line++; | |
index = 0; | |
length = lines.length; | |
while (++index < length) { | |
offsets[line] = (offsets[line] || 0) + | |
lines[index].length - trimmedLines[index].length; | |
line++; | |
} | |
return trimmedLines.join(C_NEWLINE); | |
function replacer($0, $1, $2, $3, $4) { | |
bullet = $1 + $2 + $3; | |
rest = $4; | |
/* Make sure that the first nine numbered list items | |
* can indent with an extra space. That is, when | |
* the bullet did not receive an extra final space. */ | |
if (Number($2) < 10 && bullet.length % 2 === 1) { | |
$2 = C_SPACE + $2; | |
} | |
max = $1 + repeat(C_SPACE, $2.length) + $3; | |
return max + rest; | |
} | |
} | |
},{"../util/get-indentation":43,"../util/interrupt":45,"../util/remove-indentation":47,"is-decimal":50,"repeat-string":60,"trim":63}],33:[function(require,module,exports){ | |
'use strict'; | |
var whitespace = require('is-whitespace-character'); | |
module.exports = newline; | |
/* Tokenise newline. */ | |
function newline(eat, value, silent) { | |
var character = value.charAt(0); | |
var length; | |
var subvalue; | |
var queue; | |
var index; | |
if (character !== '\n') { | |
return; | |
} | |
/* istanbul ignore if - never used (yet) */ | |
if (silent) { | |
return true; | |
} | |
index = 1; | |
length = value.length; | |
subvalue = character; | |
queue = ''; | |
while (index < length) { | |
character = value.charAt(index); | |
if (!whitespace(character)) { | |
break; | |
} | |
queue += character; | |
if (character === '\n') { | |
subvalue += queue; | |
queue = ''; | |
} | |
index++; | |
} | |
eat(subvalue); | |
} | |
},{"is-whitespace-character":51}],34:[function(require,module,exports){ | |
'use strict'; | |
var trim = require('trim'); | |
var decimal = require('is-decimal'); | |
var trimTrailingLines = require('trim-trailing-lines'); | |
var interrupt = require('../util/interrupt'); | |
module.exports = paragraph; | |
var C_NEWLINE = '\n'; | |
var C_TAB = '\t'; | |
var C_SPACE = ' '; | |
var TAB_SIZE = 4; | |
/* Tokenise paragraph. */ | |
function paragraph(eat, value, silent) { | |
var self = this; | |
var settings = self.options; | |
var commonmark = settings.commonmark; | |
var gfm = settings.gfm; | |
var tokenizers = self.blockTokenizers; | |
var interruptors = self.interruptParagraph; | |
var index = value.indexOf(C_NEWLINE); | |
var length = value.length; | |
var position; | |
var subvalue; | |
var character; | |
var size; | |
var now; | |
while (index < length) { | |
/* Eat everything if there’s no following newline. */ | |
if (index === -1) { | |
index = length; | |
break; | |
} | |
/* Stop if the next character is NEWLINE. */ | |
if (value.charAt(index + 1) === C_NEWLINE) { | |
break; | |
} | |
/* In commonmark-mode, following indented lines | |
* are part of the paragraph. */ | |
if (commonmark) { | |
size = 0; | |
position = index + 1; | |
while (position < length) { | |
character = value.charAt(position); | |
if (character === C_TAB) { | |
size = TAB_SIZE; | |
break; | |
} else if (character === C_SPACE) { | |
size++; | |
} else { | |
break; | |
} | |
position++; | |
} | |
if (size >= TAB_SIZE) { | |
index = value.indexOf(C_NEWLINE, index + 1); | |
continue; | |
} | |
} | |
subvalue = value.slice(index + 1); | |
/* Check if the following code contains a possible | |
* block. */ | |
if (interrupt(interruptors, tokenizers, self, [eat, subvalue, true])) { | |
break; | |
} | |
/* Break if the following line starts a list, when | |
* already in a list, or when in commonmark, or when | |
* in gfm mode and the bullet is *not* numeric. */ | |
if ( | |
tokenizers.list.call(self, eat, subvalue, true) && | |
( | |
self.inList || | |
commonmark || | |
(gfm && !decimal(trim.left(subvalue).charAt(0))) | |
) | |
) { | |
break; | |
} | |
position = index; | |
index = value.indexOf(C_NEWLINE, index + 1); | |
if (index !== -1 && trim(value.slice(position, index)) === '') { | |
index = position; | |
break; | |
} | |
} | |
subvalue = value.slice(0, index); | |
if (trim(subvalue) === '') { | |
eat(subvalue); | |
return null; | |
} | |
/* istanbul ignore if - never used (yet) */ | |
if (silent) { | |
return true; | |
} | |
now = eat.now(); | |
subvalue = trimTrailingLines(subvalue); | |
return eat(subvalue)({ | |
type: 'paragraph', | |
children: self.tokenizeInline(subvalue, now) | |
}); | |
} | |
},{"../util/interrupt":45,"is-decimal":50,"trim":63,"trim-trailing-lines":62}],35:[function(require,module,exports){ | |
'use strict'; | |
var whitespace = require('is-whitespace-character'); | |
var locate = require('../locate/link'); | |
var normalize = require('../util/normalize'); | |
module.exports = reference; | |
reference.locator = locate; | |
var T_LINK = 'link'; | |
var T_IMAGE = 'image'; | |
var T_FOOTNOTE = 'footnote'; | |
var REFERENCE_TYPE_SHORTCUT = 'shortcut'; | |
var REFERENCE_TYPE_COLLAPSED = 'collapsed'; | |
var REFERENCE_TYPE_FULL = 'full'; | |
var C_CARET = '^'; | |
var C_BACKSLASH = '\\'; | |
var C_BRACKET_OPEN = '['; | |
var C_BRACKET_CLOSE = ']'; | |
function reference(eat, value, silent) { | |
var self = this; | |
var character = value.charAt(0); | |
var index = 0; | |
var length = value.length; | |
var subvalue = ''; | |
var intro = ''; | |
var type = T_LINK; | |
var referenceType = REFERENCE_TYPE_SHORTCUT; | |
var content; | |
var identifier; | |
var now; | |
var node; | |
var exit; | |
var queue; | |
var bracketed; | |
var depth; | |
/* Check whether we’re eating an image. */ | |
if (character === '!') { | |
type = T_IMAGE; | |
intro = character; | |
character = value.charAt(++index); | |
} | |
if (character !== C_BRACKET_OPEN) { | |
return; | |
} | |
index++; | |
intro += character; | |
queue = ''; | |
/* Check whether we’re eating a footnote. */ | |
if ( | |
self.options.footnotes && | |
type === T_LINK && | |
value.charAt(index) === C_CARET | |
) { | |
intro += C_CARET; | |
index++; | |
type = T_FOOTNOTE; | |
} | |
/* Eat the text. */ | |
depth = 0; | |
while (index < length) { | |
character = value.charAt(index); | |
if (character === C_BRACKET_OPEN) { | |
bracketed = true; | |
depth++; | |
} else if (character === C_BRACKET_CLOSE) { | |
if (!depth) { | |
break; | |
} | |
depth--; | |
} | |
if (character === C_BACKSLASH) { | |
queue += C_BACKSLASH; | |
character = value.charAt(++index); | |
} | |
queue += character; | |
index++; | |
} | |
subvalue = queue; | |
content = queue; | |
character = value.charAt(index); | |
if (character !== C_BRACKET_CLOSE) { | |
return; | |
} | |
index++; | |
subvalue += character; | |
queue = ''; | |
while (index < length) { | |
character = value.charAt(index); | |
if (!whitespace(character)) { | |
break; | |
} | |
queue += character; | |
index++; | |
} | |
character = value.charAt(index); | |
/* Inline footnotes cannot have an identifier. */ | |
if (type !== T_FOOTNOTE && character === C_BRACKET_OPEN) { | |
identifier = ''; | |
queue += character; | |
index++; | |
while (index < length) { | |
character = value.charAt(index); | |
if (character === C_BRACKET_OPEN || character === C_BRACKET_CLOSE) { | |
break; | |
} | |
if (character === C_BACKSLASH) { | |
identifier += C_BACKSLASH; | |
character = value.charAt(++index); | |
} | |
identifier += character; | |
index++; | |
} | |
character = value.charAt(index); | |
if (character === C_BRACKET_CLOSE) { | |
referenceType = identifier ? REFERENCE_TYPE_FULL : REFERENCE_TYPE_COLLAPSED; | |
queue += identifier + character; | |
index++; | |
} else { | |
identifier = ''; | |
} | |
subvalue += queue; | |
queue = ''; | |
} else { | |
if (!content) { | |
return; | |
} | |
identifier = content; | |
} | |
/* Brackets cannot be inside the identifier. */ | |
if (referenceType !== REFERENCE_TYPE_FULL && bracketed) { | |
return; | |
} | |
subvalue = intro + subvalue; | |
if (type === T_LINK && self.inLink) { | |
return null; | |
} | |
/* istanbul ignore if - never used (yet) */ | |
if (silent) { | |
return true; | |
} | |
if (type === T_FOOTNOTE && content.indexOf(' ') !== -1) { | |
return eat(subvalue)({ | |
type: 'footnote', | |
children: this.tokenizeInline(content, eat.now()) | |
}); | |
} | |
now = eat.now(); | |
now.column += intro.length; | |
now.offset += intro.length; | |
identifier = referenceType === REFERENCE_TYPE_FULL ? identifier : content; | |
node = { | |
type: type + 'Reference', | |
identifier: normalize(identifier) | |
}; | |
if (type === T_LINK || type === T_IMAGE) { | |
node.referenceType = referenceType; | |
} | |
if (type === T_LINK) { | |
exit = self.enterLink(); | |
node.children = self.tokenizeInline(content, now); | |
exit(); | |
} else if (type === T_IMAGE) { | |
node.alt = self.decode.raw(self.unescape(content), now) || null; | |
} | |
return eat(subvalue)(node); | |
} | |
},{"../locate/link":9,"../util/normalize":46,"is-whitespace-character":51}],36:[function(require,module,exports){ | |
'use strict'; | |
var trim = require('trim'); | |
var whitespace = require('is-whitespace-character'); | |
var locate = require('../locate/strong'); | |
module.exports = strong; | |
strong.locator = locate; | |
var C_ASTERISK = '*'; | |
var C_UNDERSCORE = '_'; | |
function strong(eat, value, silent) { | |
var self = this; | |
var index = 0; | |
var character = value.charAt(index); | |
var now; | |
var pedantic; | |
var marker; | |
var queue; | |
var subvalue; | |
var length; | |
var prev; | |
if ( | |
(character !== C_ASTERISK && character !== C_UNDERSCORE) || | |
value.charAt(++index) !== character | |
) { | |
return; | |
} | |
pedantic = self.options.pedantic; | |
marker = character; | |
subvalue = marker + marker; | |
length = value.length; | |
index++; | |
queue = ''; | |
character = ''; | |
if (pedantic && whitespace(value.charAt(index))) { | |
return; | |
} | |
while (index < length) { | |
prev = character; | |
character = value.charAt(index); | |
if ( | |
character === marker && | |
value.charAt(index + 1) === marker && | |
(!pedantic || !whitespace(prev)) | |
) { | |
character = value.charAt(index + 2); | |
if (character !== marker) { | |
if (!trim(queue)) { | |
return; | |
} | |
/* istanbul ignore if - never used (yet) */ | |
if (silent) { | |
return true; | |
} | |
now = eat.now(); | |
now.column += 2; | |
now.offset += 2; | |
return eat(subvalue + queue + subvalue)({ | |
type: 'strong', | |
children: self.tokenizeInline(queue, now) | |
}); | |
} | |
} | |
if (!pedantic && character === '\\') { | |
queue += character; | |
character = value.charAt(++index); | |
} | |
queue += character; | |
index++; | |
} | |
} | |
},{"../locate/strong":10,"is-whitespace-character":51,"trim":63}],37:[function(require,module,exports){ | |
'use strict'; | |
var whitespace = require('is-whitespace-character'); | |
module.exports = table; | |
var C_BACKSLASH = '\\'; | |
var C_TICK = '`'; | |
var C_DASH = '-'; | |
var C_PIPE = '|'; | |
var C_COLON = ':'; | |
var C_SPACE = ' '; | |
var C_NEWLINE = '\n'; | |
var C_TAB = '\t'; | |
var MIN_TABLE_COLUMNS = 1; | |
var MIN_TABLE_ROWS = 2; | |
var TABLE_ALIGN_LEFT = 'left'; | |
var TABLE_ALIGN_CENTER = 'center'; | |
var TABLE_ALIGN_RIGHT = 'right'; | |
var TABLE_ALIGN_NONE = null; | |
function table(eat, value, silent) { | |
var self = this; | |
var index; | |
var alignments; | |
var alignment; | |
var subvalue; | |
var row; | |
var length; | |
var lines; | |
var queue; | |
var character; | |
var hasDash; | |
var align; | |
var cell; | |
var preamble; | |
var count; | |
var opening; | |
var now; | |
var position; | |
var lineCount; | |
var line; | |
var rows; | |
var table; | |
var lineIndex; | |
var pipeIndex; | |
var first; | |
/* Exit when not in gfm-mode. */ | |
if (!self.options.gfm) { | |
return; | |
} | |
/* Get the rows. | |
* Detecting tables soon is hard, so there are some | |
* checks for performance here, such as the minimum | |
* number of rows, and allowed characters in the | |
* alignment row. */ | |
index = 0; | |
lineCount = 0; | |
length = value.length + 1; | |
lines = []; | |
while (index < length) { | |
lineIndex = value.indexOf(C_NEWLINE, index); | |
pipeIndex = value.indexOf(C_PIPE, index + 1); | |
if (lineIndex === -1) { | |
lineIndex = value.length; | |
} | |
if (pipeIndex === -1 || pipeIndex > lineIndex) { | |
if (lineCount < MIN_TABLE_ROWS) { | |
return; | |
} | |
break; | |
} | |
lines.push(value.slice(index, lineIndex)); | |
lineCount++; | |
index = lineIndex + 1; | |
} | |
/* Parse the alignment row. */ | |
subvalue = lines.join(C_NEWLINE); | |
alignments = lines.splice(1, 1)[0] || []; | |
index = 0; | |
length = alignments.length; | |
lineCount--; | |
alignment = false; | |
align = []; | |
while (index < length) { | |
character = alignments.charAt(index); | |
if (character === C_PIPE) { | |
hasDash = null; | |
if (alignment === false) { | |
if (first === false) { | |
return; | |
} | |
} else { | |
align.push(alignment); | |
alignment = false; | |
} | |
first = false; | |
} else if (character === C_DASH) { | |
hasDash = true; | |
alignment = alignment || TABLE_ALIGN_NONE; | |
} else if (character === C_COLON) { | |
if (alignment === TABLE_ALIGN_LEFT) { | |
alignment = TABLE_ALIGN_CENTER; | |
} else if (hasDash && alignment === TABLE_ALIGN_NONE) { | |
alignment = TABLE_ALIGN_RIGHT; | |
} else { | |
alignment = TABLE_ALIGN_LEFT; | |
} | |
} else if (!whitespace(character)) { | |
return; | |
} | |
index++; | |
} | |
if (alignment !== false) { | |
align.push(alignment); | |
} | |
/* Exit when without enough columns. */ | |
if (align.length < MIN_TABLE_COLUMNS) { | |
return; | |
} | |
/* istanbul ignore if - never used (yet) */ | |
if (silent) { | |
return true; | |
} | |
/* Parse the rows. */ | |
position = -1; | |
rows = []; | |
table = eat(subvalue).reset({ | |
type: 'table', | |
align: align, | |
children: rows | |
}); | |
while (++position < lineCount) { | |
line = lines[position]; | |
row = {type: 'tableRow', children: []}; | |
/* Eat a newline character when this is not the | |
* first row. */ | |
if (position) { | |
eat(C_NEWLINE); | |
} | |
/* Eat the row. */ | |
eat(line).reset(row, table); | |
length = line.length + 1; | |
index = 0; | |
queue = ''; | |
cell = ''; | |
preamble = true; | |
count = null; | |
opening = null; | |
while (index < length) { | |
character = line.charAt(index); | |
if (character === C_TAB || character === C_SPACE) { | |
if (cell) { | |
queue += character; | |
} else { | |
eat(character); | |
} | |
index++; | |
continue; | |
} | |
if (character === '' || character === C_PIPE) { | |
if (preamble) { | |
eat(character); | |
} else { | |
if (character && opening) { | |
queue += character; | |
index++; | |
continue; | |
} | |
if ((cell || character) && !preamble) { | |
subvalue = cell; | |
if (queue.length > 1) { | |
if (character) { | |
subvalue += queue.slice(0, queue.length - 1); | |
queue = queue.charAt(queue.length - 1); | |
} else { | |
subvalue += queue; | |
queue = ''; | |
} | |
} | |
now = eat.now(); | |
eat(subvalue)({ | |
type: 'tableCell', | |
children: self.tokenizeInline(cell, now) | |
}, row); | |
} | |
eat(queue + character); | |
queue = ''; | |
cell = ''; | |
} | |
} else { | |
if (queue) { | |
cell += queue; | |
queue = ''; | |
} | |
cell += character; | |
if (character === C_BACKSLASH && index !== length - 2) { | |
cell += line.charAt(index + 1); | |
index++; | |
} | |
if (character === C_TICK) { | |
count = 1; | |
while (line.charAt(index + 1) === character) { | |
cell += character; | |
index++; | |
count++; | |
} | |
if (!opening) { | |
opening = count; | |
} else if (count >= opening) { | |
opening = 0; | |
} | |
} | |
} | |
preamble = false; | |
index++; | |
} | |
/* Eat the alignment row. */ | |
if (!position) { | |
eat(C_NEWLINE + alignments); | |
} | |
} | |
return table; | |
} | |
},{"is-whitespace-character":51}],38:[function(require,module,exports){ | |
'use strict'; | |
module.exports = text; | |
function text(eat, value, silent) { | |
var self = this; | |
var methods; | |
var tokenizers; | |
var index; | |
var length; | |
var subvalue; | |
var position; | |
var tokenizer; | |
var name; | |
var min; | |
var now; | |
/* istanbul ignore if - never used (yet) */ | |
if (silent) { | |
return true; | |
} | |
methods = self.inlineMethods; | |
length = methods.length; | |
tokenizers = self.inlineTokenizers; | |
index = -1; | |
min = value.length; | |
while (++index < length) { | |
name = methods[index]; | |
if (name === 'text' || !tokenizers[name]) { | |
continue; | |
} | |
tokenizer = tokenizers[name].locator; | |
if (!tokenizer) { | |
eat.file.fail('Missing locator: `' + name + '`'); | |
} | |
position = tokenizer.call(self, value, 1); | |
if (position !== -1 && position < min) { | |
min = position; | |
} | |
} | |
subvalue = value.slice(0, min); | |
now = eat.now(); | |
self.decode(subvalue, now, function (content, position, source) { | |
eat(source || content)({ | |
type: 'text', | |
value: content | |
}); | |
}); | |
} | |
},{}],39:[function(require,module,exports){ | |
'use strict'; | |
module.exports = thematicBreak; | |
var C_NEWLINE = '\n'; | |
var C_TAB = '\t'; | |
var C_SPACE = ' '; | |
var C_ASTERISK = '*'; | |
var C_UNDERSCORE = '_'; | |
var C_DASH = '-'; | |
var THEMATIC_BREAK_MARKER_COUNT = 3; | |
function thematicBreak(eat, value, silent) { | |
var index = -1; | |
var length = value.length + 1; | |
var subvalue = ''; | |
var character; | |
var marker; | |
var markerCount; | |
var queue; | |
while (++index < length) { | |
character = value.charAt(index); | |
if (character !== C_TAB && character !== C_SPACE) { | |
break; | |
} | |
subvalue += character; | |
} | |
if ( | |
character !== C_ASTERISK && | |
character !== C_DASH && | |
character !== C_UNDERSCORE | |
) { | |
return; | |
} | |
marker = character; | |
subvalue += character; | |
markerCount = 1; | |
queue = ''; | |
while (++index < length) { | |
character = value.charAt(index); | |
if (character === marker) { | |
markerCount++; | |
subvalue += queue + marker; | |
queue = ''; | |
} else if (character === C_SPACE) { | |
queue += character; | |
} else if ( | |
markerCount >= THEMATIC_BREAK_MARKER_COUNT && | |
(!character || character === C_NEWLINE) | |
) { | |
subvalue += queue; | |
if (silent) { | |
return true; | |
} | |
return eat(subvalue)({type: 'thematicBreak'}); | |
} else { | |
return; | |
} | |
} | |
} | |
},{}],40:[function(require,module,exports){ | |
'use strict'; | |
var decode = require('parse-entities'); | |
var whitespace = require('is-whitespace-character'); | |
var locate = require('../locate/url'); | |
module.exports = url; | |
url.locator = locate; | |
url.notInLink = true; | |
var C_BRACKET_OPEN = '['; | |
var C_BRACKET_CLOSE = ']'; | |
var C_PAREN_OPEN = '('; | |
var C_PAREN_CLOSE = ')'; | |
var C_LT = '<'; | |
var C_AT_SIGN = '@'; | |
var HTTP_PROTOCOL = 'http://'; | |
var HTTPS_PROTOCOL = 'https://'; | |
var MAILTO_PROTOCOL = 'mailto:'; | |
var PROTOCOLS = [ | |
HTTP_PROTOCOL, | |
HTTPS_PROTOCOL, | |
MAILTO_PROTOCOL | |
]; | |
var PROTOCOLS_LENGTH = PROTOCOLS.length; | |
function url(eat, value, silent) { | |
var self = this; | |
var subvalue; | |
var content; | |
var character; | |
var index; | |
var position; | |
var protocol; | |
var match; | |
var length; | |
var queue; | |
var parenCount; | |
var nextCharacter; | |
var exit; | |
if (!self.options.gfm) { | |
return; | |
} | |
subvalue = ''; | |
index = -1; | |
length = PROTOCOLS_LENGTH; | |
while (++index < length) { | |
protocol = PROTOCOLS[index]; | |
match = value.slice(0, protocol.length); | |
if (match.toLowerCase() === protocol) { | |
subvalue = match; | |
break; | |
} | |
} | |
if (!subvalue) { | |
return; | |
} | |
index = subvalue.length; | |
length = value.length; | |
queue = ''; | |
parenCount = 0; | |
while (index < length) { | |
character = value.charAt(index); | |
if (whitespace(character) || character === C_LT) { | |
break; | |
} | |
if ( | |
character === '.' || | |
character === ',' || | |
character === ':' || | |
character === ';' || | |
character === '"' || | |
character === '\'' || | |
character === ')' || | |
character === ']' | |
) { | |
nextCharacter = value.charAt(index + 1); | |
if (!nextCharacter || whitespace(nextCharacter)) { | |
break; | |
} | |
} | |
if (character === C_PAREN_OPEN || character === C_BRACKET_OPEN) { | |
parenCount++; | |
} | |
if (character === C_PAREN_CLOSE || character === C_BRACKET_CLOSE) { | |
parenCount--; | |
if (parenCount < 0) { | |
break; | |
} | |
} | |
queue += character; | |
index++; | |
} | |
if (!queue) { | |
return; | |
} | |
subvalue += queue; | |
content = subvalue; | |
if (protocol === MAILTO_PROTOCOL) { | |
position = queue.indexOf(C_AT_SIGN); | |
if (position === -1 || position === length - 1) { | |
return; | |
} | |
content = content.substr(MAILTO_PROTOCOL.length); | |
} | |
/* istanbul ignore if - never used (yet) */ | |
if (silent) { | |
return true; | |
} | |
exit = self.enterLink(); | |
content = self.tokenizeInline(content, eat.now()); | |
exit(); | |
return eat(subvalue)({ | |
type: 'link', | |
title: null, | |
url: decode(subvalue), | |
children: content | |
}); | |
} | |
},{"../locate/url":12,"is-whitespace-character":51,"parse-entities":54}],41:[function(require,module,exports){ | |
'use strict'; | |
module.exports = factory; | |
var MERGEABLE_NODES = { | |
text: mergeText, | |
blockquote: mergeBlockquote | |
}; | |
/* Check whether a node is mergeable with adjacent nodes. */ | |
function mergeable(node) { | |
var start; | |
var end; | |
if (node.type !== 'text' || !node.position) { | |
return true; | |
} | |
start = node.position.start; | |
end = node.position.end; | |
/* Only merge nodes which occupy the same size as their | |
* `value`. */ | |
return start.line !== end.line || | |
end.column - start.column === node.value.length; | |
} | |
/* Merge two text nodes: `node` into `prev`. */ | |
function mergeText(prev, node) { | |
prev.value += node.value; | |
return prev; | |
} | |
/* Merge two blockquotes: `node` into `prev`, unless in | |
* CommonMark mode. */ | |
function mergeBlockquote(prev, node) { | |
if (this.options.commonmark) { | |
return node; | |
} | |
prev.children = prev.children.concat(node.children); | |
return prev; | |
} | |
/* Construct a tokenizer. This creates both | |
* `tokenizeInline` and `tokenizeBlock`. */ | |
function factory(type) { | |
return tokenize; | |
/* Tokenizer for a bound `type`. */ | |
function tokenize(value, location) { | |
var self = this; | |
var offset = self.offset; | |
var tokens = []; | |
var methods = self[type + 'Methods']; | |
var tokenizers = self[type + 'Tokenizers']; | |
var line = location.line; | |
var column = location.column; | |
var index; | |
var length; | |
var method; | |
var name; | |
var matched; | |
var valueLength; | |
/* Trim white space only lines. */ | |
if (!value) { | |
return tokens; | |
} | |
/* Expose on `eat`. */ | |
eat.now = now; | |
eat.file = self.file; | |
/* Sync initial offset. */ | |
updatePosition(''); | |
/* Iterate over `value`, and iterate over all | |
* tokenizers. When one eats something, re-iterate | |
* with the remaining value. If no tokenizer eats, | |
* something failed (should not happen) and an | |
* exception is thrown. */ | |
while (value) { | |
index = -1; | |
length = methods.length; | |
matched = false; | |
while (++index < length) { | |
name = methods[index]; | |
method = tokenizers[name]; | |
if ( | |
method && | |
/* istanbul ignore next */ (!method.onlyAtStart || self.atStart) && | |
(!method.notInList || !self.inList) && | |
(!method.notInBlock || !self.inBlock) && | |
(!method.notInLink || !self.inLink) | |
) { | |
valueLength = value.length; | |
method.apply(self, [eat, value]); | |
matched = valueLength !== value.length; | |
if (matched) { | |
break; | |
} | |
} | |
} | |
/* istanbul ignore if */ | |
if (!matched) { | |
self.file.fail(new Error('Infinite loop'), eat.now()); | |
} | |
} | |
self.eof = now(); | |
return tokens; | |
/* Update line, column, and offset based on | |
* `value`. */ | |
function updatePosition(subvalue) { | |
var lastIndex = -1; | |
var index = subvalue.indexOf('\n'); | |
while (index !== -1) { | |
line++; | |
lastIndex = index; | |
index = subvalue.indexOf('\n', index + 1); | |
} | |
if (lastIndex === -1) { | |
column += subvalue.length; | |
} else { | |
column = subvalue.length - lastIndex; | |
} | |
if (line in offset) { | |
if (lastIndex !== -1) { | |
column += offset[line]; | |
} else if (column <= offset[line]) { | |
column = offset[line] + 1; | |
} | |
} | |
} | |
/* Get offset. Called before the first character is | |
* eaten to retrieve the range's offsets. */ | |
function getOffset() { | |
var indentation = []; | |
var pos = line + 1; | |
/* Done. Called when the last character is | |
* eaten to retrieve the range’s offsets. */ | |
return function () { | |
var last = line + 1; | |
while (pos < last) { | |
indentation.push((offset[pos] || 0) + 1); | |
pos++; | |
} | |
return indentation; | |
}; | |
} | |
/* Get the current position. */ | |
function now() { | |
var pos = {line: line, column: column}; | |
pos.offset = self.toOffset(pos); | |
return pos; | |
} | |
/* Store position information for a node. */ | |
function Position(start) { | |
this.start = start; | |
this.end = now(); | |
} | |
/* Throw when a value is incorrectly eaten. | |
* This shouldn’t happen but will throw on new, | |
* incorrect rules. */ | |
function validateEat(subvalue) { | |
/* istanbul ignore if */ | |
if (value.substring(0, subvalue.length) !== subvalue) { | |
/* Capture stack-trace. */ | |
self.file.fail( | |
new Error( | |
'Incorrectly eaten value: please report this ' + | |
'warning on http://git.io/vg5Ft' | |
), | |
now() | |
); | |
} | |
} | |
/* Mark position and patch `node.position`. */ | |
function position() { | |
var before = now(); | |
return update; | |
/* Add the position to a node. */ | |
function update(node, indent) { | |
var prev = node.position; | |
var start = prev ? prev.start : before; | |
var combined = []; | |
var n = prev && prev.end.line; | |
var l = before.line; | |
node.position = new Position(start); | |
/* If there was already a `position`, this | |
* node was merged. Fixing `start` wasn’t | |
* hard, but the indent is different. | |
* Especially because some information, the | |
* indent between `n` and `l` wasn’t | |
* tracked. Luckily, that space is | |
* (should be?) empty, so we can safely | |
* check for it now. */ | |
if (prev && indent && prev.indent) { | |
combined = prev.indent; | |
if (n < l) { | |
while (++n < l) { | |
combined.push((offset[n] || 0) + 1); | |
} | |
combined.push(before.column); | |
} | |
indent = combined.concat(indent); | |
} | |
node.position.indent = indent || []; | |
return node; | |
} | |
} | |
/* Add `node` to `parent`s children or to `tokens`. | |
* Performs merges where possible. */ | |
function add(node, parent) { | |
var children = parent ? parent.children : tokens; | |
var prev = children[children.length - 1]; | |
if ( | |
prev && | |
node.type === prev.type && | |
node.type in MERGEABLE_NODES && | |
mergeable(prev) && | |
mergeable(node) | |
) { | |
node = MERGEABLE_NODES[node.type].call(self, prev, node); | |
} | |
if (node !== prev) { | |
children.push(node); | |
} | |
if (self.atStart && tokens.length !== 0) { | |
self.exitStart(); | |
} | |
return node; | |
} | |
/* Remove `subvalue` from `value`. | |
* `subvalue` must be at the start of `value`. */ | |
function eat(subvalue) { | |
var indent = getOffset(); | |
var pos = position(); | |
var current = now(); | |
validateEat(subvalue); | |
apply.reset = reset; | |
reset.test = test; | |
apply.test = test; | |
value = value.substring(subvalue.length); | |
updatePosition(subvalue); | |
indent = indent(); | |
return apply; | |
/* Add the given arguments, add `position` to | |
* the returned node, and return the node. */ | |
function apply(node, parent) { | |
return pos(add(pos(node), parent), indent); | |
} | |
/* Functions just like apply, but resets the | |
* content: the line and column are reversed, | |
* and the eaten value is re-added. | |
* This is useful for nodes with a single | |
* type of content, such as lists and tables. | |
* See `apply` above for what parameters are | |
* expected. */ | |
function reset() { | |
var node = apply.apply(null, arguments); | |
line = current.line; | |
column = current.column; | |
value = subvalue + value; | |
return node; | |
} | |
/* Test the position, after eating, and reverse | |
* to a not-eaten state. */ | |
function test() { | |
var result = pos({}); | |
line = current.line; | |
column = current.column; | |
value = subvalue + value; | |
return result.position; | |
} | |
} | |
} | |
} | |
},{}],42:[function(require,module,exports){ | |
'use strict'; | |
module.exports = factory; | |
/* Factory to de-escape a value, based on a list at `key` | |
* in `ctx`. */ | |
function factory(ctx, key) { | |
return unescape; | |
/* De-escape a string using the expression at `key` | |
* in `ctx`. */ | |
function unescape(value) { | |
var prev = 0; | |
var index = value.indexOf('\\'); | |
var escape = ctx[key]; | |
var queue = []; | |
var character; | |
while (index !== -1) { | |
queue.push(value.slice(prev, index)); | |
prev = index + 1; | |
character = value.charAt(prev); | |
/* If the following character is not a valid escape, | |
* add the slash. */ | |
if (!character || escape.indexOf(character) === -1) { | |
queue.push('\\'); | |
} | |
index = value.indexOf('\\', prev); | |
} | |
queue.push(value.slice(prev)); | |
return queue.join(''); | |
} | |
} | |
},{}],43:[function(require,module,exports){ | |
'use strict'; | |
module.exports = indentation; | |
/* Map of characters, and their column length, | |
* which can be used as indentation. */ | |
var characters = {' ': 1, '\t': 4}; | |
/* Gets indentation information for a line. */ | |
function indentation(value) { | |
var index = 0; | |
var indent = 0; | |
var character = value.charAt(index); | |
var stops = {}; | |
var size; | |
while (character in characters) { | |
size = characters[character]; | |
indent += size; | |
if (size > 1) { | |
indent = Math.floor(indent / size) * size; | |
} | |
stops[indent] = index; | |
character = value.charAt(++index); | |
} | |
return {indent: indent, stops: stops}; | |
} | |
},{}],44:[function(require,module,exports){ | |
'use strict'; | |
var attributeName = '[a-zA-Z_:][a-zA-Z0-9:._-]*'; | |
var unquoted = '[^"\'=<>`\\u0000-\\u0020]+'; | |
var singleQuoted = '\'[^\']*\''; | |
var doubleQuoted = '"[^"]*"'; | |
var attributeValue = '(?:' + unquoted + '|' + singleQuoted + '|' + doubleQuoted + ')'; | |
var attribute = '(?:\\s+' + attributeName + '(?:\\s*=\\s*' + attributeValue + ')?)'; | |
var openTag = '<[A-Za-z][A-Za-z0-9\\-]*' + attribute + '*\\s*\\/?>'; | |
var closeTag = '<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>'; | |
var comment = '<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->'; | |
var processing = '<[?].*?[?]>'; | |
var declaration = '<![A-Za-z]+\\s+[^>]*>'; | |
var cdata = '<!\\[CDATA\\[[\\s\\S]*?\\]\\]>'; | |
exports.openCloseTag = new RegExp('^(?:' + openTag + '|' + closeTag + ')'); | |
exports.tag = new RegExp('^(?:' + | |
openTag + '|' + | |
closeTag + '|' + | |
comment + '|' + | |
processing + '|' + | |
declaration + '|' + | |
cdata + | |
')'); | |
},{}],45:[function(require,module,exports){ | |
'use strict'; | |
module.exports = interrupt; | |
function interrupt(interruptors, tokenizers, ctx, params) { | |
var bools = ['pedantic', 'commonmark']; | |
var count = bools.length; | |
var length = interruptors.length; | |
var index = -1; | |
var interruptor; | |
var config; | |
var fn; | |
var offset; | |
var bool; | |
var ignore; | |
while (++index < length) { | |
interruptor = interruptors[index]; | |
config = interruptor[1] || {}; | |
fn = interruptor[0]; | |
offset = -1; | |
ignore = false; | |
while (++offset < count) { | |
bool = bools[offset]; | |
if (config[bool] !== undefined && config[bool] !== ctx.options[bool]) { | |
ignore = true; | |
break; | |
} | |
} | |
if (ignore) { | |
continue; | |
} | |
if (tokenizers[fn].apply(ctx, params)) { | |
return true; | |
} | |
} | |
return false; | |
} | |
},{}],46:[function(require,module,exports){ | |
'use strict'; | |
var collapseWhiteSpace = require('collapse-white-space'); | |
module.exports = normalize; | |
/* Normalize an identifier. Collapses multiple white space | |
* characters into a single space, and removes casing. */ | |
function normalize(value) { | |
return collapseWhiteSpace(value).toLowerCase(); | |
} | |
},{"collapse-white-space":48}],47:[function(require,module,exports){ | |
'use strict'; | |
var trim = require('trim'); | |
var repeat = require('repeat-string'); | |
var getIndent = require('./get-indentation'); | |
module.exports = indentation; | |
var C_SPACE = ' '; | |
var C_NEWLINE = '\n'; | |
var C_TAB = '\t'; | |
/* Remove the minimum indent from every line in `value`. | |
* Supports both tab, spaced, and mixed indentation (as | |
* well as possible). */ | |
function indentation(value, maximum) { | |
var values = value.split(C_NEWLINE); | |
var position = values.length + 1; | |
var minIndent = Infinity; | |
var matrix = []; | |
var index; | |
var indentation; | |
var stops; | |
var padding; | |
values.unshift(repeat(C_SPACE, maximum) + '!'); | |
while (position--) { | |
indentation = getIndent(values[position]); | |
matrix[position] = indentation.stops; | |
if (trim(values[position]).length === 0) { | |
continue; | |
} | |
if (indentation.indent) { | |
if (indentation.indent > 0 && indentation.indent < minIndent) { | |
minIndent = indentation.indent; | |
} | |
} else { | |
minIndent = Infinity; | |
break; | |
} | |
} | |
if (minIndent !== Infinity) { | |
position = values.length; | |
while (position--) { | |
stops = matrix[position]; | |
index = minIndent; | |
while (index && !(index in stops)) { | |
index--; | |
} | |
if ( | |
trim(values[position]).length !== 0 && | |
minIndent && | |
index !== minIndent | |
) { | |
padding = C_TAB; | |
} else { | |
padding = ''; | |
} | |
values[position] = padding + values[position].slice( | |
index in stops ? stops[index] + 1 : 0 | |
); | |
} | |
} | |
values.shift(); | |
return values.join(C_NEWLINE); | |
} | |
},{"./get-indentation":43,"repeat-string":60,"trim":63}],48:[function(require,module,exports){ | |
'use strict'; | |
module.exports = collapse; | |
/* collapse(' \t\nbar \nbaz\t'); // ' bar baz ' */ | |
function collapse(value) { | |
return String(value).replace(/\s+/g, ' '); | |
} | |
},{}],49:[function(require,module,exports){ | |
'use strict'; | |
module.exports = alphabetical; | |
/* Check if the given character code, or the character | |
* code at the first character, is alphabetical. */ | |
function alphabetical(character) { | |
var code = typeof character === 'string' ? | |
character.charCodeAt(0) : character; | |
return (code >= 97 && code <= 122) || /* a-z */ | |
(code >= 65 && code <= 90); /* A-Z */ | |
} | |
},{}],50:[function(require,module,exports){ | |
'use strict'; | |
module.exports = decimal; | |
/* Check if the given character code, or the character | |
* code at the first character, is decimal. */ | |
function decimal(character) { | |
var code = typeof character === 'string' ? | |
character.charCodeAt(0) : character; | |
return code >= 48 && code <= 57; /* 0-9 */ | |
} | |
},{}],51:[function(require,module,exports){ | |
'use strict'; | |
module.exports = whitespace; | |
var fromCode = String.fromCharCode; | |
var re = /\s/; | |
/* Check if the given character code, or the character | |
* code at the first character, is a whitespace character. */ | |
function whitespace(character) { | |
return re.test( | |
typeof character === 'number' ? fromCode(character) : character.charAt(0) | |
); | |
} | |
},{}],52:[function(require,module,exports){ | |
'use strict'; | |
module.exports = wordCharacter; | |
var fromCode = String.fromCharCode; | |
var re = /\w/; | |
/* Check if the given character code, or the character | |
* code at the first character, is a word character. */ | |
function wordCharacter(character) { | |
return re.test( | |
typeof character === 'number' ? fromCode(character) : character.charAt(0) | |
); | |
} | |
},{}],53:[function(require,module,exports){ | |
'use strict'; | |
module.exports = escapes; | |
var defaults = [ | |
'\\', | |
'`', | |
'*', | |
'{', | |
'}', | |
'[', | |
']', | |
'(', | |
')', | |
'#', | |
'+', | |
'-', | |
'.', | |
'!', | |
'_', | |
'>' | |
]; | |
var gfm = defaults.concat(['~', '|']); | |
var commonmark = gfm.concat([ | |
'\n', | |
'"', | |
'$', | |
'%', | |
'&', | |
'\'', | |
',', | |
'/', | |
':', | |
';', | |
'<', | |
'=', | |
'?', | |
'@', | |
'^' | |
]); | |
escapes.default = defaults; | |
escapes.gfm = gfm; | |
escapes.commonmark = commonmark; | |
/* Get markdown escapes. */ | |
function escapes(options) { | |
var settings = options || {}; | |
if (settings.commonmark) { | |
return commonmark; | |
} | |
return settings.gfm ? gfm : defaults; | |
} | |
},{}],54:[function(require,module,exports){ | |
'use strict'; | |
/* Dependencies. */ | |
var characterEntities = require('character-entities'); | |
var legacy = require('character-entities-legacy'); | |
var invalid = require('character-reference-invalid'); | |
var decimal = require('is-decimal'); | |
var hexadecimal = require('is-hexadecimal'); | |
var alphanumerical = require('is-alphanumerical'); | |
/* Expose. */ | |
module.exports = wrapper; | |
/* Methods. */ | |
var own = {}.hasOwnProperty; | |
var fromCharCode = String.fromCharCode; | |
var noop = Function.prototype; | |
/* Characters. */ | |
var REPLACEMENT = '\uFFFD'; | |
var FORM_FEED = '\f'; | |
var AMPERSAND = '&'; | |
var OCTOTHORP = '#'; | |
var SEMICOLON = ';'; | |
var NEWLINE = '\n'; | |
var X_LOWER = 'x'; | |
var X_UPPER = 'X'; | |
var SPACE = ' '; | |
var LESS_THAN = '<'; | |
var EQUAL = '='; | |
var EMPTY = ''; | |
var TAB = '\t'; | |
/* Default settings. */ | |
var defaults = { | |
warning: null, | |
reference: null, | |
text: null, | |
warningContext: null, | |
referenceContext: null, | |
textContext: null, | |
position: {}, | |
additional: null, | |
attribute: false, | |
nonTerminated: true | |
}; | |
/* Reference types. */ | |
var NAMED = 'named'; | |
var HEXADECIMAL = 'hexadecimal'; | |
var DECIMAL = 'decimal'; | |
/* Map of bases. */ | |
var BASE = {}; | |
BASE[HEXADECIMAL] = 16; | |
BASE[DECIMAL] = 10; | |
/* Map of types to tests. Each type of character reference | |
* accepts different characters. This test is used to | |
* detect whether a reference has ended (as the semicolon | |
* is not strictly needed). */ | |
var TESTS = {}; | |
TESTS[NAMED] = alphanumerical; | |
TESTS[DECIMAL] = decimal; | |
TESTS[HEXADECIMAL] = hexadecimal; | |
/* Warning messages. */ | |
var NAMED_NOT_TERMINATED = 1; | |
var NUMERIC_NOT_TERMINATED = 2; | |
var NAMED_EMPTY = 3; | |
var NUMERIC_EMPTY = 4; | |
var NAMED_UNKNOWN = 5; | |
var NUMERIC_DISALLOWED = 6; | |
var NUMERIC_PROHIBITED = 7; | |
var NUMERIC_REFERENCE = 'Numeric character references'; | |
var NAMED_REFERENCE = 'Named character references'; | |
var TERMINATED = ' must be terminated by a semicolon'; | |
var VOID = ' cannot be empty'; | |
var MESSAGES = {}; | |
MESSAGES[NAMED_NOT_TERMINATED] = NAMED_REFERENCE + TERMINATED; | |
MESSAGES[NUMERIC_NOT_TERMINATED] = NUMERIC_REFERENCE + TERMINATED; | |
MESSAGES[NAMED_EMPTY] = NAMED_REFERENCE + VOID; | |
MESSAGES[NUMERIC_EMPTY] = NUMERIC_REFERENCE + VOID; | |
MESSAGES[NAMED_UNKNOWN] = NAMED_REFERENCE + ' must be known'; | |
MESSAGES[NUMERIC_DISALLOWED] = NUMERIC_REFERENCE + ' cannot be disallowed'; | |
MESSAGES[NUMERIC_PROHIBITED] = NUMERIC_REFERENCE + ' cannot be outside the ' + | |
'permissible Unicode range'; | |
/* Wrap to ensure clean parameters are given to `parse`. */ | |
function wrapper(value, options) { | |
var settings = {}; | |
var option; | |
var key; | |
if (!options) { | |
options = {}; | |
} | |
for (key in defaults) { | |
option = options[key]; | |
settings[key] = option === null || option === undefined ? defaults[key] : option; | |
} | |
if (settings.position.indent || settings.position.start) { | |
settings.indent = settings.position.indent || []; | |
settings.position = settings.position.start; | |
} | |
return parse(value, settings); | |
} | |
/* Parse entities. */ | |
function parse(value, settings) { | |
var additional = settings.additional; | |
var nonTerminated = settings.nonTerminated; | |
var handleText = settings.text; | |
var handleReference = settings.reference; | |
var handleWarning = settings.warning; | |
var textContext = settings.textContext; | |
var referenceContext = settings.referenceContext; | |
var warningContext = settings.warningContext; | |
var pos = settings.position; | |
var indent = settings.indent || []; | |
var length = value.length; | |
var index = 0; | |
var lines = -1; | |
var column = pos.column || 1; | |
var line = pos.line || 1; | |
var queue = EMPTY; | |
var result = []; | |
var entityCharacters; | |
var terminated; | |
var characters; | |
var character; | |
var reference; | |
var following; | |
var warning; | |
var reason; | |
var output; | |
var entity; | |
var begin; | |
var start; | |
var type; | |
var test; | |
var prev; | |
var next; | |
var diff; | |
var end; | |
/* Cache the current point. */ | |
prev = now(); | |
/* Wrap `handleWarning`. */ | |
warning = handleWarning ? parseError : noop; | |
/* Ensure the algorithm walks over the first character | |
* and the end (inclusive). */ | |
index--; | |
length++; | |
while (++index < length) { | |
/* If the previous character was a newline. */ | |
if (character === NEWLINE) { | |
column = indent[lines] || 1; | |
} | |
character = at(index); | |
/* Handle anything other than an ampersand, | |
* including newlines and EOF. */ | |
if (character !== AMPERSAND) { | |
if (character === NEWLINE) { | |
line++; | |
lines++; | |
column = 0; | |
} | |
if (character) { | |
queue += character; | |
column++; | |
} else { | |
flush(); | |
} | |
} else { | |
following = at(index + 1); | |
/* The behaviour depends on the identity of the next | |
* character. */ | |
if ( | |
following === TAB || | |
following === NEWLINE || | |
following === FORM_FEED || | |
following === SPACE || | |
following === LESS_THAN || | |
following === AMPERSAND || | |
following === EMPTY || | |
(additional && following === additional) | |
) { | |
/* Not a character reference. No characters | |
* are consumed, and nothing is returned. | |
* This is not an error, either. */ | |
queue += character; | |
column++; | |
continue; | |
} | |
start = index + 1; | |
begin = start; | |
end = start; | |
/* Numerical entity. */ | |
if (following !== OCTOTHORP) { | |
type = NAMED; | |
} else { | |
end = ++begin; | |
/* The behaviour further depends on the | |
* character after the U+0023 NUMBER SIGN. */ | |
following = at(end); | |
if (following === X_LOWER || following === X_UPPER) { | |
/* ASCII hex digits. */ | |
type = HEXADECIMAL; | |
end = ++begin; | |
} else { | |
/* ASCII digits. */ | |
type = DECIMAL; | |
} | |
} | |
entityCharacters = EMPTY; | |
entity = EMPTY; | |
characters = EMPTY; | |
test = TESTS[type]; | |
end--; | |
while (++end < length) { | |
following = at(end); | |
if (!test(following)) { | |
break; | |
} | |
characters += following; | |
/* Check if we can match a legacy named | |
* reference. If so, we cache that as the | |
* last viable named reference. This | |
* ensures we do not need to walk backwards | |
* later. */ | |
if (type === NAMED && own.call(legacy, characters)) { | |
entityCharacters = characters; | |
entity = legacy[characters]; | |
} | |
} | |
terminated = at(end) === SEMICOLON; | |
if (terminated) { | |
end++; | |
if (type === NAMED && own.call(characterEntities, characters)) { | |
entityCharacters = characters; | |
entity = characterEntities[characters]; | |
} | |
} | |
diff = 1 + end - start; | |
if (!terminated && !nonTerminated) { | |
/* Empty. */ | |
} else if (!characters) { | |
/* An empty (possible) entity is valid, unless | |
* its numeric (thus an ampersand followed by | |
* an octothorp). */ | |
if (type !== NAMED) { | |
warning(NUMERIC_EMPTY, diff); | |
} | |
} else if (type === NAMED) { | |
/* An ampersand followed by anything | |
* unknown, and not terminated, is invalid. */ | |
if (terminated && !entity) { | |
warning(NAMED_UNKNOWN, 1); | |
} else { | |
/* If theres something after an entity | |
* name which is not known, cap the | |
* reference. */ | |
if (entityCharacters !== characters) { | |
end = begin + entityCharacters.length; | |
diff = 1 + end - begin; | |
terminated = false; | |
} | |
/* If the reference is not terminated, | |
* warn. */ | |
if (!terminated) { | |
reason = entityCharacters ? | |
NAMED_NOT_TERMINATED : | |
NAMED_EMPTY; | |
if (!settings.attribute) { | |
warning(reason, diff); | |
} else { | |
following = at(end); | |
if (following === EQUAL) { | |
warning(reason, diff); | |
entity = null; | |
} else if (alphanumerical(following)) { | |
entity = null; | |
} else { | |
warning(reason, diff); | |
} | |
} | |
} | |
} | |
reference = entity; | |
} else { | |
if (!terminated) { | |
/* All non-terminated numeric entities are | |
* not rendered, and trigger a warning. */ | |
warning(NUMERIC_NOT_TERMINATED, diff); | |
} | |
/* When terminated and number, parse as | |
* either hexadecimal or decimal. */ | |
reference = parseInt(characters, BASE[type]); | |
/* Trigger a warning when the parsed number | |
* is prohibited, and replace with | |
* replacement character. */ | |
if (isProhibited(reference)) { | |
warning(NUMERIC_PROHIBITED, diff); | |
reference = REPLACEMENT; | |
} else if (reference in invalid) { | |
/* Trigger a warning when the parsed number | |
* is disallowed, and replace by an | |
* alternative. */ | |
warning(NUMERIC_DISALLOWED, diff); | |
reference = invalid[reference]; | |
} else { | |
/* Parse the number. */ | |
output = EMPTY; | |
/* Trigger a warning when the parsed | |
* number should not be used. */ | |
if (isWarning(reference)) { | |
warning(NUMERIC_DISALLOWED, diff); | |
} | |
/* Stringify the number. */ | |
if (reference > 0xFFFF) { | |
reference -= 0x10000; | |
output += fromCharCode((reference >>> (10 & 0x3FF)) | 0xD800); | |
reference = 0xDC00 | (reference & 0x3FF); | |
} | |
reference = output + fromCharCode(reference); | |
} | |
} | |
/* If we could not find a reference, queue the | |
* checked characters (as normal characters), | |
* and move the pointer to their end. This is | |
* possible because we can be certain neither | |
* newlines nor ampersands are included. */ | |
if (!reference) { | |
characters = value.slice(start - 1, end); | |
queue += characters; | |
column += characters.length; | |
index = end - 1; | |
} else { | |
/* Found it! First eat the queued | |
* characters as normal text, then eat | |
* an entity. */ | |
flush(); | |
prev = now(); | |
index = end - 1; | |
column += end - start + 1; | |
result.push(reference); | |
next = now(); | |
next.offset++; | |
if (handleReference) { | |
handleReference.call(referenceContext, reference, { | |
start: prev, | |
end: next | |
}, value.slice(start - 1, end)); | |
} | |
prev = next; | |
} | |
} | |
} | |
/* Return the reduced nodes, and any possible warnings. */ | |
return result.join(EMPTY); | |
/* Get current position. */ | |
function now() { | |
return { | |
line: line, | |
column: column, | |
offset: index + (pos.offset || 0) | |
}; | |
} | |
/* “Throw” a parse-error: a warning. */ | |
function parseError(code, offset) { | |
var position = now(); | |
position.column += offset; | |
position.offset += offset; | |
handleWarning.call(warningContext, MESSAGES[code], position, code); | |
} | |
/* Get character at position. */ | |
function at(position) { | |
return value.charAt(position); | |
} | |
/* Flush `queue` (normal text). Macro invoked before | |
* each entity and at the end of `value`. | |
* Does nothing when `queue` is empty. */ | |
function flush() { | |
if (queue) { | |
result.push(queue); | |
if (handleText) { | |
handleText.call(textContext, queue, { | |
start: prev, | |
end: now() | |
}); | |
} | |
queue = EMPTY; | |
} | |
} | |
} | |
/* Check if `character` is outside the permissible | |
* unicode range. */ | |
function isProhibited(code) { | |
return (code >= 0xD800 && code <= 0xDFFF) || (code > 0x10FFFF); | |
} | |
/* Check if `character` is disallowed. */ | |
function isWarning(code) { | |
if ( | |
(code >= 0x0001 && code <= 0x0008) || | |
code === 0x000B || | |
(code >= 0x000D && code <= 0x001F) || | |
(code >= 0x007F && code <= 0x009F) || | |
(code >= 0xFDD0 && code <= 0xFDEF) || | |
(code & 0xFFFF) === 0xFFFF || | |
(code & 0xFFFF) === 0xFFFE | |
) { | |
return true; | |
} | |
return false; | |
} | |
},{"character-entities":56,"character-entities-legacy":55,"character-reference-invalid":57,"is-alphanumerical":58,"is-decimal":50,"is-hexadecimal":59}],55:[function(require,module,exports){ | |
module.exports={ | |
"AElig": "Æ", | |
"AMP": "&", | |
"Aacute": "Á", | |
"Acirc": "Â", | |
"Agrave": "À", | |
"Aring": "Å", | |
"Atilde": "Ã", | |
"Auml": "Ä", | |
"COPY": "©", | |
"Ccedil": "Ç", | |
"ETH": "Ð", | |
"Eacute": "É", | |
"Ecirc": "Ê", | |
"Egrave": "È", | |
"Euml": "Ë", | |
"GT": ">", | |
"Iacute": "Í", | |
"Icirc": "Î", | |
"Igrave": "Ì", | |
"Iuml": "Ï", | |
"LT": "<", | |
"Ntilde": "Ñ", | |
"Oacute": "Ó", | |
"Ocirc": "Ô", | |
"Ograve": "Ò", | |
"Oslash": "Ø", | |
"Otilde": "Õ", | |
"Ouml": "Ö", | |
"QUOT": "\"", | |
"REG": "®", | |
"THORN": "Þ", | |
"Uacute": "Ú", | |
"Ucirc": "Û", | |
"Ugrave": "Ù", | |
"Uuml": "Ü", | |
"Yacute": "Ý", | |
"aacute": "á", | |
"acirc": "â", | |
"acute": "´", | |
"aelig": "æ", | |
"agrave": "à", | |
"amp": "&", | |
"aring": "å", | |
"atilde": "ã", | |
"auml": "ä", | |
"brvbar": "¦", | |
"ccedil": "ç", | |
"cedil": "¸", | |
"cent": "¢", | |
"copy": "©", | |
"curren": "¤", | |
"deg": "°", | |
"divide": "÷", | |
"eacute": "é", | |
"ecirc": "ê", | |
"egrave": "è", | |
"eth": "ð", | |
"euml": "ë", | |
"frac12": "½", | |
"frac14": "¼", | |
"frac34": "¾", | |
"gt": ">", | |
"iacute": "í", | |
"icirc": "î", | |
"iexcl": "¡", | |
"igrave": "ì", | |
"iquest": "¿", | |
"iuml": "ï", | |
"laquo": "«", | |
"lt": "<", | |
"macr": "¯", | |
"micro": "µ", | |
"middot": "·", | |
"nbsp": " ", | |
"not": "¬", | |
"ntilde": "ñ", | |
"oacute": "ó", | |
"ocirc": "ô", | |
"ograve": "ò", | |
"ordf": "ª", | |
"ordm": "º", | |
"oslash": "ø", | |
"otilde": "õ", | |
"ouml": "ö", | |
"para": "¶", | |
"plusmn": "±", | |
"pound": "£", | |
"quot": "\"", | |
"raquo": "»", | |
"reg": "®", | |
"sect": "§", | |
"shy": "", | |
"sup1": "¹", | |
"sup2": "²", | |
"sup3": "³", | |
"szlig": "ß", | |
"thorn": "þ", | |
"times": "×", | |
"uacute": "ú", | |
"ucirc": "û", | |
"ugrave": "ù", | |
"uml": "¨", | |
"uuml": "ü", | |
"yacute": "ý", | |
"yen": "¥", | |
"yuml": "ÿ" | |
} | |
},{}],56:[function(require,module,exports){ | |
module.exports={ | |
"AEli": "Æ", | |
"AElig": "Æ", | |
"AM": "&", | |
"AMP": "&", | |
"Aacut": "Á", | |
"Aacute": "Á", | |
"Abreve": "Ă", | |
"Acir": "Â", | |
"Acirc": "Â", | |
"Acy": "А", | |
"Afr": "𝔄", | |
"Agrav": "À", | |
"Agrave": "À", | |
"Alpha": "Α", | |
"Amacr": "Ā", | |
"And": "⩓", | |
"Aogon": "Ą", | |
"Aopf": "𝔸", | |
"ApplyFunction": "", | |
"Arin": "Å", | |
"Aring": "Å", | |
"Ascr": "𝒜", | |
"Assign": "≔", | |
"Atild": "Ã", | |
"Atilde": "Ã", | |
"Aum": "Ä", | |
"Auml": "Ä", | |
"Backslash": "∖", | |
"Barv": "⫧", | |
"Barwed": "⌆", | |
"Bcy": "Б", | |
"Because": "∵", | |
"Bernoullis": "ℬ", | |
"Beta": "Β", | |
"Bfr": "𝔅", | |
"Bopf": "𝔹", | |
"Breve": "˘", | |
"Bscr": "ℬ", | |
"Bumpeq": "≎", | |
"CHcy": "Ч", | |
"COP": "©", | |
"COPY": "©", | |
"Cacute": "Ć", | |
"Cap": "⋒", | |
"CapitalDifferentialD": "ⅅ", | |
"Cayleys": "ℭ", | |
"Ccaron": "Č", | |
"Ccedi": "Ç", | |
"Ccedil": "Ç", | |
"Ccirc": "Ĉ", | |
"Cconint": "∰", | |
"Cdot": "Ċ", | |
"Cedilla": "¸", | |
"CenterDot": "·", | |
"Cfr": "ℭ", | |
"Chi": "Χ", | |
"CircleDot": "⊙", | |
"CircleMinus": "⊖", | |
"CirclePlus": "⊕", | |
"CircleTimes": "⊗", | |
"ClockwiseContourIntegral": "∲", | |
"CloseCurlyDoubleQuote": "”", | |
"CloseCurlyQuote": "’", | |
"Colon": "∷", | |
"Colone": "⩴", | |
"Congruent": "≡", | |
"Conint": "∯", | |
"ContourIntegral": "∮", | |
"Copf": "ℂ", | |
"Coproduct": "∐", | |
"CounterClockwiseContourIntegral": "∳", | |
"Cross": "⨯", | |
"Cscr": "𝒞", | |
"Cup": "⋓", | |
"CupCap": "≍", | |
"DD": "ⅅ", | |
"DDotrahd": "⤑", | |
"DJcy": "Ђ", | |
"DScy": "Ѕ", | |
"DZcy": "Џ", | |
"Dagger": "‡", | |
"Darr": "↡", | |
"Dashv": "⫤", | |
"Dcaron": "Ď", | |
"Dcy": "Д", | |
"Del": "∇", | |
"Delta": "Δ", | |
"Dfr": "𝔇", | |
"DiacriticalAcute": "´", | |
"DiacriticalDot": "˙", | |
"DiacriticalDoubleAcute": "˝", | |
"DiacriticalGrave": "`", | |
"DiacriticalTilde": "˜", | |
"Diamond": "⋄", | |
"DifferentialD": "ⅆ", | |
"Dopf": "𝔻", | |
"Dot": "¨", | |
"DotDot": "⃜", | |
"DotEqual": "≐", | |
"DoubleContourIntegral": "∯", | |
"DoubleDot": "¨", | |
"DoubleDownArrow": "⇓", | |
"DoubleLeftArrow": "⇐", | |
"DoubleLeftRightArrow": "⇔", | |
"DoubleLeftTee": "⫤", | |
"DoubleLongLeftArrow": "⟸", | |
"DoubleLongLeftRightArrow": "⟺", | |
"DoubleLongRightArrow": "⟹", | |
"DoubleRightArrow": "⇒", | |
"DoubleRightTee": "⊨", | |
"DoubleUpArrow": "⇑", | |
"DoubleUpDownArrow": "⇕", | |
"DoubleVerticalBar": "∥", | |
"DownArrow": "↓", | |
"DownArrowBar": "⤓", | |
"DownArrowUpArrow": "⇵", | |
"DownBreve": "̑", | |
"DownLeftRightVector": "⥐", | |
"DownLeftTeeVector": "⥞", | |
"DownLeftVector": "↽", | |
"DownLeftVectorBar": "⥖", | |
"DownRightTeeVector": "⥟", | |
"DownRightVector": "⇁", | |
"DownRightVectorBar": "⥗", | |
"DownTee": "⊤", | |
"DownTeeArrow": "↧", | |
"Downarrow": "⇓", | |
"Dscr": "𝒟", | |
"Dstrok": "Đ", | |
"ENG": "Ŋ", | |
"ET": "Ð", | |
"ETH": "Ð", | |
"Eacut": "É", | |
"Eacute": "É", | |
"Ecaron": "Ě", | |
"Ecir": "Ê", | |
"Ecirc": "Ê", | |
"Ecy": "Э", | |
"Edot": "Ė", | |
"Efr": "𝔈", | |
"Egrav": "È", | |
"Egrave": "È", | |
"Element": "∈", | |
"Emacr": "Ē", | |
"EmptySmallSquare": "◻", | |
"EmptyVerySmallSquare": "▫", | |
"Eogon": "Ę", | |
"Eopf": "𝔼", | |
"Epsilon": "Ε", | |
"Equal": "⩵", | |
"EqualTilde": "≂", | |
"Equilibrium": "⇌", | |
"Escr": "ℰ", | |
"Esim": "⩳", | |
"Eta": "Η", | |
"Eum": "Ë", | |
"Euml": "Ë", | |
"Exists": "∃", | |
"ExponentialE": "ⅇ", | |
"Fcy": "Ф", | |
"Ffr": "𝔉", | |
"FilledSmallSquare": "◼", | |
"FilledVerySmallSquare": "▪", | |
"Fopf": "𝔽", | |
"ForAll": "∀", | |
"Fouriertrf": "ℱ", | |
"Fscr": "ℱ", | |
"GJcy": "Ѓ", | |
"G": ">", | |
"GT": ">", | |
"Gamma": "Γ", | |
"Gammad": "Ϝ", | |
"Gbreve": "Ğ", | |
"Gcedil": "Ģ", | |
"Gcirc": "Ĝ", | |
"Gcy": "Г", | |
"Gdot": "Ġ", | |
"Gfr": "𝔊", | |
"Gg": "⋙", | |
"Gopf": "𝔾", | |
"GreaterEqual": "≥", | |
"GreaterEqualLess": "⋛", | |
"GreaterFullEqual": "≧", | |
"GreaterGreater": "⪢", | |
"GreaterLess": "≷", | |
"GreaterSlantEqual": "⩾", | |
"GreaterTilde": "≳", | |
"Gscr": "𝒢", | |
"Gt": "≫", | |
"HARDcy": "Ъ", | |
"Hacek": "ˇ", | |
"Hat": "^", | |
"Hcirc": "Ĥ", | |
"Hfr": "ℌ", | |
"HilbertSpace": "ℋ", | |
"Hopf": "ℍ", | |
"HorizontalLine": "─", | |
"Hscr": "ℋ", | |
"Hstrok": "Ħ", | |
"HumpDownHump": "≎", | |
"HumpEqual": "≏", | |
"IEcy": "Е", | |
"IJlig": "IJ", | |
"IOcy": "Ё", | |
"Iacut": "Í", | |
"Iacute": "Í", | |
"Icir": "Î", | |
"Icirc": "Î", | |
"Icy": "И", | |
"Idot": "İ", | |
"Ifr": "ℑ", | |
"Igrav": "Ì", | |
"Igrave": "Ì", | |
"Im": "ℑ", | |
"Imacr": "Ī", | |
"ImaginaryI": "ⅈ", | |
"Implies": "⇒", | |
"Int": "∬", | |
"Integral": "∫", | |
"Intersection": "⋂", | |
"InvisibleComma": "", | |
"InvisibleTimes": "", | |
"Iogon": "Į", | |
"Iopf": "𝕀", | |
"Iota": "Ι", | |
"Iscr": "ℐ", | |
"Itilde": "Ĩ", | |
"Iukcy": "І", | |
"Ium": "Ï", | |
"Iuml": "Ï", | |
"Jcirc": "Ĵ", | |
"Jcy": "Й", | |
"Jfr": "𝔍", | |
"Jopf": "𝕁", | |
"Jscr": "𝒥", | |
"Jsercy": "Ј", | |
"Jukcy": "Є", | |
"KHcy": "Х", | |
"KJcy": "Ќ", | |
"Kappa": "Κ", | |
"Kcedil": "Ķ", | |
"Kcy": "К", | |
"Kfr": "𝔎", | |
"Kopf": "𝕂", | |
"Kscr": "𝒦", | |
"LJcy": "Љ", | |
"L": "<", | |
"LT": "<", | |
"Lacute": "Ĺ", | |
"Lambda": "Λ", | |
"Lang": "⟪", | |
"Laplacetrf": "ℒ", | |
"Larr": "↞", | |
"Lcaron": "Ľ", | |
"Lcedil": "Ļ", | |
"Lcy": "Л", | |
"LeftAngleBracket": "⟨", | |
"LeftArrow": "←", | |
"LeftArrowBar": "⇤", | |
"LeftArrowRightArrow": "⇆", | |
"LeftCeiling": "⌈", | |
"LeftDoubleBracket": "⟦", | |
"LeftDownTeeVector": "⥡", | |
"LeftDownVector": "⇃", | |
"LeftDownVectorBar": "⥙", | |
"LeftFloor": "⌊", | |
"LeftRightArrow": "↔", | |
"LeftRightVector": "⥎", | |
"LeftTee": "⊣", | |
"LeftTeeArrow": "↤", | |
"LeftTeeVector": "⥚", | |
"LeftTriangle": "⊲", | |
"LeftTriangleBar": "⧏", | |
"LeftTriangleEqual": "⊴", | |
"LeftUpDownVector": "⥑", | |
"LeftUpTeeVector": "⥠", | |
"LeftUpVector": "↿", | |
"LeftUpVectorBar": "⥘", | |
"LeftVector": "↼", | |
"LeftVectorBar": "⥒", | |
"Leftarrow": "⇐", | |
"Leftrightarrow": "⇔", | |
"LessEqualGreater": "⋚", | |
"LessFullEqual": "≦", | |
"LessGreater": "≶", | |
"LessLess": "⪡", | |
"LessSlantEqual": "⩽", | |
"LessTilde": "≲", | |
"Lfr": "𝔏", | |
"Ll": "⋘", | |
"Lleftarrow": "⇚", | |
"Lmidot": "Ŀ", | |
"LongLeftArrow": "⟵", | |
"LongLeftRightArrow": "⟷", | |
"LongRightArrow": "⟶", | |
"Longleftarrow": "⟸", | |
"Longleftrightarrow": "⟺", | |
"Longrightarrow": "⟹", | |
"Lopf": "𝕃", | |
"LowerLeftArrow": "↙", | |
"LowerRightArrow": "↘", | |
"Lscr": "ℒ", | |
"Lsh": "↰", | |
"Lstrok": "Ł", | |
"Lt": "≪", | |
"Map": "⤅", | |
"Mcy": "М", | |
"MediumSpace": " ", | |
"Mellintrf": "ℳ", | |
"Mfr": "𝔐", | |
"MinusPlus": "∓", | |
"Mopf": "𝕄", | |
"Mscr": "ℳ", | |
"Mu": "Μ", | |
"NJcy": "Њ", | |
"Nacute": "Ń", | |
"Ncaron": "Ň", | |
"Ncedil": "Ņ", | |
"Ncy": "Н", | |
"NegativeMediumSpace": "", | |
"NegativeThickSpace": "", | |
"NegativeThinSpace": "", | |
"NegativeVeryThinSpace": "", | |
"NestedGreaterGreater": "≫", | |
"NestedLessLess": "≪", | |
"NewLine": "\n", | |
"Nfr": "𝔑", | |
"NoBreak": "", | |
"NonBreakingSpace": " ", | |
"Nopf": "ℕ", | |
"Not": "⫬", | |
"NotCongruent": "≢", | |
"NotCupCap": "≭", | |
"NotDoubleVerticalBar": "∦", | |
"NotElement": "∉", | |
"NotEqual": "≠", | |
"NotEqualTilde": "≂̸", | |
"NotExists": "∄", | |
"NotGreater": "≯", | |
"NotGreaterEqual": "≱", | |
"NotGreaterFullEqual": "≧̸", | |
"NotGreaterGreater": "≫̸", | |
"NotGreaterLess": "≹", | |
"NotGreaterSlantEqual": "⩾̸", | |
"NotGreaterTilde": "≵", | |
"NotHumpDownHump": "≎̸", | |
"NotHumpEqual": "≏̸", | |
"NotLeftTriangle": "⋪", | |
"NotLeftTriangleBar": "⧏̸", | |
"NotLeftTriangleEqual": "⋬", | |
"NotLess": "≮", | |
"NotLessEqual": "≰", | |
"NotLessGreater": "≸", | |
"NotLessLess": "≪̸", | |
"NotLessSlantEqual": "⩽̸", | |
"NotLessTilde": "≴", | |
"NotNestedGreaterGreater": "⪢̸", | |
"NotNestedLessLess": "⪡̸", | |
"NotPrecedes": "⊀", | |
"NotPrecedesEqual": "⪯̸", | |
"NotPrecedesSlantEqual": "⋠", | |
"NotReverseElement": "∌", | |
"NotRightTriangle": "⋫", | |
"NotRightTriangleBar": "⧐̸", | |
"NotRightTriangleEqual": "⋭", | |
"NotSquareSubset": "⊏̸", | |
"NotSquareSubsetEqual": "⋢", | |
"NotSquareSuperset": "⊐̸", | |
"NotSquareSupersetEqual": "⋣", | |
"NotSubset": "⊂⃒", | |
"NotSubsetEqual": "⊈", | |
"NotSucceeds": "⊁", | |
"NotSucceedsEqual": "⪰̸", | |
"NotSucceedsSlantEqual": "⋡", | |
"NotSucceedsTilde": "≿̸", | |
"NotSuperset": "⊃⃒", | |
"NotSupersetEqual": "⊉", | |
"NotTilde": "≁", | |
"NotTildeEqual": "≄", | |
"NotTildeFullEqual": "≇", | |
"NotTildeTilde": "≉", | |
"NotVerticalBar": "∤", | |
"Nscr": "𝒩", | |
"Ntild": "Ñ", | |
"Ntilde": "Ñ", | |
"Nu": "Ν", | |
"OElig": "Œ", | |
"Oacut": "Ó", | |
"Oacute": "Ó", | |
"Ocir": "Ô", | |
"Ocirc": "Ô", | |
"Ocy": "О", | |
"Odblac": "Ő", | |
"Ofr": "𝔒", | |
"Ograv": "Ò", | |
"Ograve": "Ò", | |
"Omacr": "Ō", | |
"Omega": "Ω", | |
"Omicron": "Ο", | |
"Oopf": "𝕆", | |
"OpenCurlyDoubleQuote": "“", | |
"OpenCurlyQuote": "‘", | |
"Or": "⩔", | |
"Oscr": "𝒪", | |
"Oslas": "Ø", | |
"Oslash": "Ø", | |
"Otild": "Õ", | |
"Otilde": "Õ", | |
"Otimes": "⨷", | |
"Oum": "Ö", | |
"Ouml": "Ö", | |
"OverBar": "‾", | |
"OverBrace": "⏞", | |
"OverBracket": "⎴", | |
"OverParenthesis": "⏜", | |
"PartialD": "∂", | |
"Pcy": "П", | |
"Pfr": "𝔓", | |
"Phi": "Φ", | |
"Pi": "Π", | |
"PlusMinus": "±", | |
"Poincareplane": "ℌ", | |
"Popf": "ℙ", | |
"Pr": "⪻", | |
"Precedes": "≺", | |
"PrecedesEqual": "⪯", | |
"PrecedesSlantEqual": "≼", | |
"PrecedesTilde": "≾", | |
"Prime": "″", | |
"Product": "∏", | |
"Proportion": "∷", | |
"Proportional": "∝", | |
"Pscr": "𝒫", | |
"Psi": "Ψ", | |
"QUO": "\"", | |
"QUOT": "\"", | |
"Qfr": "𝔔", | |
"Qopf": "ℚ", | |
"Qscr": "𝒬", | |
"RBarr": "⤐", | |
"RE": "®", | |
"REG": "®", | |
"Racute": "Ŕ", | |
"Rang": "⟫", | |
"Rarr": "↠", | |
"Rarrtl": "⤖", | |
"Rcaron": "Ř", | |
"Rcedil": "Ŗ", | |
"Rcy": "Р", | |
"Re": "ℜ", | |
"ReverseElement": "∋", | |
"ReverseEquilibrium": "⇋", | |
"ReverseUpEquilibrium": "⥯", | |
"Rfr": "ℜ", | |
"Rho": "Ρ", | |
"RightAngleBracket": "⟩", | |
"RightArrow": "→", | |
"RightArrowBar": "⇥", | |
"RightArrowLeftArrow": "⇄", | |
"RightCeiling": "⌉", | |
"RightDoubleBracket": "⟧", | |
"RightDownTeeVector": "⥝", | |
"RightDownVector": "⇂", | |
"RightDownVectorBar": "⥕", | |
"RightFloor": "⌋", | |
"RightTee": "⊢", | |
"RightTeeArrow": "↦", | |
"RightTeeVector": "⥛", | |
"RightTriangle": "⊳", | |
"RightTriangleBar": "⧐", | |
"RightTriangleEqual": "⊵", | |
"RightUpDownVector": "⥏", | |
"RightUpTeeVector": "⥜", | |
"RightUpVector": "↾", | |
"RightUpVectorBar": "⥔", | |
"RightVector": "⇀", | |
"RightVectorBar": "⥓", | |
"Rightarrow": "⇒", | |
"Ropf": "ℝ", | |
"RoundImplies": "⥰", | |
"Rrightarrow": "⇛", | |
"Rscr": "ℛ", | |
"Rsh": "↱", | |
"RuleDelayed": "⧴", | |
"SHCHcy": "Щ", | |
"SHcy": "Ш", | |
"SOFTcy": "Ь", | |
"Sacute": "Ś", | |
"Sc": "⪼", | |
"Scaron": "Š", | |
"Scedil": "Ş", | |
"Scirc": "Ŝ", | |
"Scy": "С", | |
"Sfr": "𝔖", | |
"ShortDownArrow": "↓", | |
"ShortLeftArrow": "←", | |
"ShortRightArrow": "→", | |
"ShortUpArrow": "↑", | |
"Sigma": "Σ", | |
"SmallCircle": "∘", | |
"Sopf": "𝕊", | |
"Sqrt": "√", | |
"Square": "□", | |
"SquareIntersection": "⊓", | |
"SquareSubset": "⊏", | |
"SquareSubsetEqual": "⊑", | |
"SquareSuperset": "⊐", | |
"SquareSupersetEqual": "⊒", | |
"SquareUnion": "⊔", | |
"Sscr": "𝒮", | |
"Star": "⋆", | |
"Sub": "⋐", | |
"Subset": "⋐", | |
"SubsetEqual": "⊆", | |
"Succeeds": "≻", | |
"SucceedsEqual": "⪰", | |
"SucceedsSlantEqual": "≽", | |
"SucceedsTilde": "≿", | |
"SuchThat": "∋", | |
"Sum": "∑", | |
"Sup": "⋑", | |
"Superset": "⊃", | |
"SupersetEqual": "⊇", | |
"Supset": "⋑", | |
"THOR": "Þ", | |
"THORN": "Þ", | |
"TRADE": "™", | |
"TSHcy": "Ћ", | |
"TScy": "Ц", | |
"Tab": "\t", | |
"Tau": "Τ", | |
"Tcaron": "Ť", | |
"Tcedil": "Ţ", | |
"Tcy": "Т", | |
"Tfr": "𝔗", | |
"Therefore": "∴", | |
"Theta": "Θ", | |
"ThickSpace": " ", | |
"ThinSpace": " ", | |
"Tilde": "∼", | |
"TildeEqual": "≃", | |
"TildeFullEqual": "≅", | |
"TildeTilde": "≈", | |
"Topf": "𝕋", | |
"TripleDot": "⃛", | |
"Tscr": "𝒯", | |
"Tstrok": "Ŧ", | |
"Uacut": "Ú", | |
"Uacute": "Ú", | |
"Uarr": "↟", | |
"Uarrocir": "⥉", | |
"Ubrcy": "Ў", | |
"Ubreve": "Ŭ", | |
"Ucir": "Û", | |
"Ucirc": "Û", | |
"Ucy": "У", | |
"Udblac": "Ű", | |
"Ufr": "𝔘", | |
"Ugrav": "Ù", | |
"Ugrave": "Ù", | |
"Umacr": "Ū", | |
"UnderBar": "_", | |
"UnderBrace": "⏟", | |
"UnderBracket": "⎵", | |
"UnderParenthesis": "⏝", | |
"Union": "⋃", | |
"UnionPlus": "⊎", | |
"Uogon": "Ų", | |
"Uopf": "𝕌", | |
"UpArrow": "↑", | |
"UpArrowBar": "⤒", | |
"UpArrowDownArrow": "⇅", | |
"UpDownArrow": "↕", | |
"UpEquilibrium": "⥮", | |
"UpTee": "⊥", | |
"UpTeeArrow": "↥", | |
"Uparrow": "⇑", | |
"Updownarrow": "⇕", | |
"UpperLeftArrow": "↖", | |
"UpperRightArrow": "↗", | |
"Upsi": "ϒ", | |
"Upsilon": "Υ", | |
"Uring": "Ů", | |
"Uscr": "𝒰", | |
"Utilde": "Ũ", | |
"Uum": "Ü", | |
"Uuml": "Ü", | |
"VDash": "⊫", | |
"Vbar": "⫫", | |
"Vcy": "В", | |
"Vdash": "⊩", | |
"Vdashl": "⫦", | |
"Vee": "⋁", | |
"Verbar": "‖", | |
"Vert": "‖", | |
"VerticalBar": "∣", | |
"VerticalLine": "|", | |
"VerticalSeparator": "❘", | |
"VerticalTilde": "≀", | |
"VeryThinSpace": " ", | |
"Vfr": "𝔙", | |
"Vopf": "𝕍", | |
"Vscr": "𝒱", | |
"Vvdash": "⊪", | |
"Wcirc": "Ŵ", | |
"Wedge": "⋀", | |
"Wfr": "𝔚", | |
"Wopf": "𝕎", | |
"Wscr": "𝒲", | |
"Xfr": "𝔛", | |
"Xi": "Ξ", | |
"Xopf": "𝕏", | |
"Xscr": "𝒳", | |
"YAcy": "Я", | |
"YIcy": "Ї", | |
"YUcy": "Ю", | |
"Yacut": "Ý", | |
"Yacute": "Ý", | |
"Ycirc": "Ŷ", | |
"Ycy": "Ы", | |
"Yfr": "𝔜", | |
"Yopf": "𝕐", | |
"Yscr": "𝒴", | |
"Yuml": "Ÿ", | |
"ZHcy": "Ж", | |
"Zacute": "Ź", | |
"Zcaron": "Ž", | |
"Zcy": "З", | |
"Zdot": "Ż", | |
"ZeroWidthSpace": "", | |
"Zeta": "Ζ", | |
"Zfr": "ℨ", | |
"Zopf": "ℤ", | |
"Zscr": "𝒵", | |
"aacut": "á", | |
"aacute": "á", | |
"abreve": "ă", | |
"ac": "∾", | |
"acE": "∾̳", | |
"acd": "∿", | |
"acir": "â", | |
"acirc": "â", | |
"acut": "´", | |
"acute": "´", | |
"acy": "а", | |
"aeli": "æ", | |
"aelig": "æ", | |
"af": "", | |
"afr": "𝔞", | |
"agrav": "à", | |
"agrave": "à", | |
"alefsym": "ℵ", | |
"aleph": "ℵ", | |
"alpha": "α", | |
"amacr": "ā", | |
"amalg": "⨿", | |
"am": "&", | |
"amp": "&", | |
"and": "∧", | |
"andand": "⩕", | |
"andd": "⩜", | |
"andslope": "⩘", | |
"andv": "⩚", | |
"ang": "∠", | |
"ange": "⦤", | |
"angle": "∠", | |
"angmsd": "∡", | |
"angmsdaa": "⦨", | |
"angmsdab": "⦩", | |
"angmsdac": "⦪", | |
"angmsdad": "⦫", | |
"angmsdae": "⦬", | |
"angmsdaf": "⦭", | |
"angmsdag": "⦮", | |
"angmsdah": "⦯", | |
"angrt": "∟", | |
"angrtvb": "⊾", | |
"angrtvbd": "⦝", | |
"angsph": "∢", | |
"angst": "Å", | |
"angzarr": "⍼", | |
"aogon": "ą", | |
"aopf": "𝕒", | |
"ap": "≈", | |
"apE": "⩰", | |
"apacir": "⩯", | |
"ape": "≊", | |
"apid": "≋", | |
"apos": "'", | |
"approx": "≈", | |
"approxeq": "≊", | |
"arin": "å", | |
"aring": "å", | |
"ascr": "𝒶", | |
"ast": "*", | |
"asymp": "≈", | |
"asympeq": "≍", | |
"atild": "ã", | |
"atilde": "ã", | |
"aum": "ä", | |
"auml": "ä", | |
"awconint": "∳", | |
"awint": "⨑", | |
"bNot": "⫭", | |
"backcong": "≌", | |
"backepsilon": "϶", | |
"backprime": "‵", | |
"backsim": "∽", | |
"backsimeq": "⋍", | |
"barvee": "⊽", | |
"barwed": "⌅", | |
"barwedge": "⌅", | |
"bbrk": "⎵", | |
"bbrktbrk": "⎶", | |
"bcong": "≌", | |
"bcy": "б", | |
"bdquo": "„", | |
"becaus": "∵", | |
"because": "∵", | |
"bemptyv": "⦰", | |
"bepsi": "϶", | |
"bernou": "ℬ", | |
"beta": "β", | |
"beth": "ℶ", | |
"between": "≬", | |
"bfr": "𝔟", | |
"bigcap": "⋂", | |
"bigcirc": "◯", | |
"bigcup": "⋃", | |
"bigodot": "⨀", | |
"bigoplus": "⨁", | |
"bigotimes": "⨂", | |
"bigsqcup": "⨆", | |
"bigstar": "★", | |
"bigtriangledown": "▽", | |
"bigtriangleup": "△", | |
"biguplus": "⨄", | |
"bigvee": "⋁", | |
"bigwedge": "⋀", | |
"bkarow": "⤍", | |
"blacklozenge": "⧫", | |
"blacksquare": "▪", | |
"blacktriangle": "▴", | |
"blacktriangledown": "▾", | |
"blacktriangleleft": "◂", | |
"blacktriangleright": "▸", | |
"blank": "␣", | |
"blk12": "▒", | |
"blk14": "░", | |
"blk34": "▓", | |
"block": "█", | |
"bne": "=⃥", | |
"bnequiv": "≡⃥", | |
"bnot": "⌐", | |
"bopf": "𝕓", | |
"bot": "⊥", | |
"bottom": "⊥", | |
"bowtie": "⋈", | |
"boxDL": "╗", | |
"boxDR": "╔", | |
"boxDl": "╖", | |
"boxDr": "╓", | |
"boxH": "═", | |
"boxHD": "╦", | |
"boxHU": "╩", | |
"boxHd": "╤", | |
"boxHu": "╧", | |
"boxUL": "╝", | |
"boxUR": "╚", | |
"boxUl": "╜", | |
"boxUr": "╙", | |
"boxV": "║", | |
"boxVH": "╬", | |
"boxVL": "╣", | |
"boxVR": "╠", | |
"boxVh": "╫", | |
"boxVl": "╢", | |
"boxVr": "╟", | |
"boxbox": "⧉", | |
"boxdL": "╕", | |
"boxdR": "╒", | |
"boxdl": "┐", | |
"boxdr": "┌", | |
"boxh": "─", | |
"boxhD": "╥", | |
"boxhU": "╨", | |
"boxhd": "┬", | |
"boxhu": "┴", | |
"boxminus": "⊟", | |
"boxplus": "⊞", | |
"boxtimes": "⊠", | |
"boxuL": "╛", | |
"boxuR": "╘", | |
"boxul": "┘", | |
"boxur": "└", | |
"boxv": "│", | |
"boxvH": "╪", | |
"boxvL": "╡", | |
"boxvR": "╞", | |
"boxvh": "┼", | |
"boxvl": "┤", | |
"boxvr": "├", | |
"bprime": "‵", | |
"breve": "˘", | |
"brvba": "¦", | |
"brvbar": "¦", | |
"bscr": "𝒷", | |
"bsemi": "⁏", | |
"bsim": "∽", | |
"bsime": "⋍", | |
"bsol": "\\", | |
"bsolb": "⧅", | |
"bsolhsub": "⟈", | |
"bull": "•", | |
"bullet": "•", | |
"bump": "≎", | |
"bumpE": "⪮", | |
"bumpe": "≏", | |
"bumpeq": "≏", | |
"cacute": "ć", | |
"cap": "∩", | |
"capand": "⩄", | |
"capbrcup": "⩉", | |
"capcap": "⩋", | |
"capcup": "⩇", | |
"capdot": "⩀", | |
"caps": "∩︀", | |
"caret": "⁁", | |
"caron": "ˇ", | |
"ccaps": "⩍", | |
"ccaron": "č", | |
"ccedi": "ç", | |
"ccedil": "ç", | |
"ccirc": "ĉ", | |
"ccups": "⩌", | |
"ccupssm": "⩐", | |
"cdot": "ċ", | |
"cedi": "¸", | |
"cedil": "¸", | |
"cemptyv": "⦲", | |
"cen": "¢", | |
"cent": "¢", | |
"centerdot": "·", | |
"cfr": "𝔠", | |
"chcy": "ч", | |
"check": "✓", | |
"checkmark": "✓", | |
"chi": "χ", | |
"cir": "○", | |
"cirE": "⧃", | |
"circ": "ˆ", | |
"circeq": "≗", | |
"circlearrowleft": "↺", | |
"circlearrowright": "↻", | |
"circledR": "®", | |
"circledS": "Ⓢ", | |
"circledast": "⊛", | |
"circledcirc": "⊚", | |
"circleddash": "⊝", | |
"cire": "≗", | |
"cirfnint": "⨐", | |
"cirmid": "⫯", | |
"cirscir": "⧂", | |
"clubs": "♣", | |
"clubsuit": "♣", | |
"colon": ":", | |
"colone": "≔", | |
"coloneq": "≔", | |
"comma": ",", | |
"commat": "@", | |
"comp": "∁", | |
"compfn": "∘", | |
"complement": "∁", | |
"complexes": "ℂ", | |
"cong": "≅", | |
"congdot": "⩭", | |
"conint": "∮", | |
"copf": "𝕔", | |
"coprod": "∐", | |
"cop": "©", | |
"copy": "©", | |
"copysr": "℗", | |
"crarr": "↵", | |
"cross": "✗", | |
"cscr": "𝒸", | |
"csub": "⫏", | |
"csube": "⫑", | |
"csup": "⫐", | |
"csupe": "⫒", | |
"ctdot": "⋯", | |
"cudarrl": "⤸", | |
"cudarrr": "⤵", | |
"cuepr": "⋞", | |
"cuesc": "⋟", | |
"cularr": "↶", | |
"cularrp": "⤽", | |
"cup": "∪", | |
"cupbrcap": "⩈", | |
"cupcap": "⩆", | |
"cupcup": "⩊", | |
"cupdot": "⊍", | |
"cupor": "⩅", | |
"cups": "∪︀", | |
"curarr": "↷", | |
"curarrm": "⤼", | |
"curlyeqprec": "⋞", | |
"curlyeqsucc": "⋟", | |
"curlyvee": "⋎", | |
"curlywedge": "⋏", | |
"curre": "¤", | |
"curren": "¤", | |
"curvearrowleft": "↶", | |
"curvearrowright": "↷", | |
"cuvee": "⋎", | |
"cuwed": "⋏", | |
"cwconint": "∲", | |
"cwint": "∱", | |
"cylcty": "⌭", | |
"dArr": "⇓", | |
"dHar": "⥥", | |
"dagger": "†", | |
"daleth": "ℸ", | |
"darr": "↓", | |
"dash": "‐", | |
"dashv": "⊣", | |
"dbkarow": "⤏", | |
"dblac": "˝", | |
"dcaron": "ď", | |
"dcy": "д", | |
"dd": "ⅆ", | |
"ddagger": "‡", | |
"ddarr": "⇊", | |
"ddotseq": "⩷", | |
"de": "°", | |
"deg": "°", | |
"delta": "δ", | |
"demptyv": "⦱", | |
"dfisht": "⥿", | |
"dfr": "𝔡", | |
"dharl": "⇃", | |
"dharr": "⇂", | |
"diam": "⋄", | |
"diamond": "⋄", | |
"diamondsuit": "♦", | |
"diams": "♦", | |
"die": "¨", | |
"digamma": "ϝ", | |
"disin": "⋲", | |
"div": "÷", | |
"divid": "÷", | |
"divide": "÷", | |
"divideontimes": "⋇", | |
"divonx": "⋇", | |
"djcy": "ђ", | |
"dlcorn": "⌞", | |
"dlcrop": "⌍", | |
"dollar": "$", | |
"dopf": "𝕕", | |
"dot": "˙", | |
"doteq": "≐", | |
"doteqdot": "≑", | |
"dotminus": "∸", | |
"dotplus": "∔", | |
"dotsquare": "⊡", | |
"doublebarwedge": "⌆", | |
"downarrow": "↓", | |
"downdownarrows": "⇊", | |
"downharpoonleft": "⇃", | |
"downharpoonright": "⇂", | |
"drbkarow": "⤐", | |
"drcorn": "⌟", | |
"drcrop": "⌌", | |
"dscr": "𝒹", | |
"dscy": "ѕ", | |
"dsol": "⧶", | |
"dstrok": "đ", | |
"dtdot": "⋱", | |
"dtri": "▿", | |
"dtrif": "▾", | |
"duarr": "⇵", | |
"duhar": "⥯", | |
"dwangle": "⦦", | |
"dzcy": "џ", | |
"dzigrarr": "⟿", | |
"eDDot": "⩷", | |
"eDot": "≑", | |
"eacut": "é", | |
"eacute": "é", | |
"easter": "⩮", | |
"ecaron": "ě", | |
"ecir": "ê", | |
"ecirc": "ê", | |
"ecolon": "≕", | |
"ecy": "э", | |
"edot": "ė", | |
"ee": "ⅇ", | |
"efDot": "≒", | |
"efr": "𝔢", | |
"eg": "⪚", | |
"egrav": "è", | |
"egrave": "è", | |
"egs": "⪖", | |
"egsdot": "⪘", | |
"el": "⪙", | |
"elinters": "⏧", | |
"ell": "ℓ", | |
"els": "⪕", | |
"elsdot": "⪗", | |
"emacr": "ē", | |
"empty": "∅", | |
"emptyset": "∅", | |
"emptyv": "∅", | |
"emsp13": " ", | |
"emsp14": " ", | |
"emsp": " ", | |
"eng": "ŋ", | |
"ensp": " ", | |
"eogon": "ę", | |
"eopf": "𝕖", | |
"epar": "⋕", | |
"eparsl": "⧣", | |
"eplus": "⩱", | |
"epsi": "ε", | |
"epsilon": "ε", | |
"epsiv": "ϵ", | |
"eqcirc": "≖", | |
"eqcolon": "≕", | |
"eqsim": "≂", | |
"eqslantgtr": "⪖", | |
"eqslantless": "⪕", | |
"equals": "=", | |
"equest": "≟", | |
"equiv": "≡", | |
"equivDD": "⩸", | |
"eqvparsl": "⧥", | |
"erDot": "≓", | |
"erarr": "⥱", | |
"escr": "ℯ", | |
"esdot": "≐", | |
"esim": "≂", | |
"eta": "η", | |
"et": "ð", | |
"eth": "ð", | |
"eum": "ë", | |
"euml": "ë", | |
"euro": "€", | |
"excl": "!", | |
"exist": "∃", | |
"expectation": "ℰ", | |
"exponentiale": "ⅇ", | |
"fallingdotseq": "≒", | |
"fcy": "ф", | |
"female": "♀", | |
"ffilig": "ffi", | |
"fflig": "ff", | |
"ffllig": "ffl", | |
"ffr": "𝔣", | |
"filig": "fi", | |
"fjlig": "fj", | |
"flat": "♭", | |
"fllig": "fl", | |
"fltns": "▱", | |
"fnof": "ƒ", | |
"fopf": "𝕗", | |
"forall": "∀", | |
"fork": "⋔", | |
"forkv": "⫙", | |
"fpartint": "⨍", | |
"frac1": "¼", | |
"frac12": "½", | |
"frac13": "⅓", | |
"frac14": "¼", | |
"frac15": "⅕", | |
"frac16": "⅙", | |
"frac18": "⅛", | |
"frac23": "⅔", | |
"frac25": "⅖", | |
"frac3": "¾", | |
"frac34": "¾", | |
"frac35": "⅗", | |
"frac38": "⅜", | |
"frac45": "⅘", | |
"frac56": "⅚", | |
"frac58": "⅝", | |
"frac78": "⅞", | |
"frasl": "⁄", | |
"frown": "⌢", | |
"fscr": "𝒻", | |
"gE": "≧", | |
"gEl": "⪌", | |
"gacute": "ǵ", | |
"gamma": "γ", | |
"gammad": "ϝ", | |
"gap": "⪆", | |
"gbreve": "ğ", | |
"gcirc": "ĝ", | |
"gcy": "г", | |
"gdot": "ġ", | |
"ge": "≥", | |
"gel": "⋛", | |
"geq": "≥", | |
"geqq": "≧", | |
"geqslant": "⩾", | |
"ges": "⩾", | |
"gescc": "⪩", | |
"gesdot": "⪀", | |
"gesdoto": "⪂", | |
"gesdotol": "⪄", | |
"gesl": "⋛︀", | |
"gesles": "⪔", | |
"gfr": "𝔤", | |
"gg": "≫", | |
"ggg": "⋙", | |
"gimel": "ℷ", | |
"gjcy": "ѓ", | |
"gl": "≷", | |
"glE": "⪒", | |
"gla": "⪥", | |
"glj": "⪤", | |
"gnE": "≩", | |
"gnap": "⪊", | |
"gnapprox": "⪊", | |
"gne": "⪈", | |
"gneq": "⪈", | |
"gneqq": "≩", | |
"gnsim": "⋧", | |
"gopf": "𝕘", | |
"grave": "`", | |
"gscr": "ℊ", | |
"gsim": "≳", | |
"gsime": "⪎", | |
"gsiml": "⪐", | |
"g": ">", | |
"gt": ">", | |
"gtcc": "⪧", | |
"gtcir": "⩺", | |
"gtdot": "⋗", | |
"gtlPar": "⦕", | |
"gtquest": "⩼", | |
"gtrapprox": "⪆", | |
"gtrarr": "⥸", | |
"gtrdot": "⋗", | |
"gtreqless": "⋛", | |
"gtreqqless": "⪌", | |
"gtrless": "≷", | |
"gtrsim": "≳", | |
"gvertneqq": "≩︀", | |
"gvnE": "≩︀", | |
"hArr": "⇔", | |
"hairsp": " ", | |
"half": "½", | |
"hamilt": "ℋ", | |
"hardcy": "ъ", | |
"harr": "↔", | |
"harrcir": "⥈", | |
"harrw": "↭", | |
"hbar": "ℏ", | |
"hcirc": "ĥ", | |
"hearts": "♥", | |
"heartsuit": "♥", | |
"hellip": "…", | |
"hercon": "⊹", | |
"hfr": "𝔥", | |
"hksearow": "⤥", | |
"hkswarow": "⤦", | |
"hoarr": "⇿", | |
"homtht": "∻", | |
"hookleftarrow": "↩", | |
"hookrightarrow": "↪", | |
"hopf": "𝕙", | |
"horbar": "―", | |
"hscr": "𝒽", | |
"hslash": "ℏ", | |
"hstrok": "ħ", | |
"hybull": "⁃", | |
"hyphen": "‐", | |
"iacut": "í", | |
"iacute": "í", | |
"ic": "", | |
"icir": "î", | |
"icirc": "î", | |
"icy": "и", | |
"iecy": "е", | |
"iexc": "¡", | |
"iexcl": "¡", | |
"iff": "⇔", | |
"ifr": "𝔦", | |
"igrav": "ì", | |
"igrave": "ì", | |
"ii": "ⅈ", | |
"iiiint": "⨌", | |
"iiint": "∭", | |
"iinfin": "⧜", | |
"iiota": "℩", | |
"ijlig": "ij", | |
"imacr": "ī", | |
"image": "ℑ", | |
"imagline": "ℐ", | |
"imagpart": "ℑ", | |
"imath": "ı", | |
"imof": "⊷", | |
"imped": "Ƶ", | |
"in": "∈", | |
"incare": "℅", | |
"infin": "∞", | |
"infintie": "⧝", | |
"inodot": "ı", | |
"int": "∫", | |
"intcal": "⊺", | |
"integers": "ℤ", | |
"intercal": "⊺", | |
"intlarhk": "⨗", | |
"intprod": "⨼", | |
"iocy": "ё", | |
"iogon": "į", | |
"iopf": "𝕚", | |
"iota": "ι", | |
"iprod": "⨼", | |
"iques": "¿", | |
"iquest": "¿", | |
"iscr": "𝒾", | |
"isin": "∈", | |
"isinE": "⋹", | |
"isindot": "⋵", | |
"isins": "⋴", | |
"isinsv": "⋳", | |
"isinv": "∈", | |
"it": "", | |
"itilde": "ĩ", | |
"iukcy": "і", | |
"ium": "ï", | |
"iuml": "ï", | |
"jcirc": "ĵ", | |
"jcy": "й", | |
"jfr": "𝔧", | |
"jmath": "ȷ", | |
"jopf": "𝕛", | |
"jscr": "𝒿", | |
"jsercy": "ј", | |
"jukcy": "є", | |
"kappa": "κ", | |
"kappav": "ϰ", | |
"kcedil": "ķ", | |
"kcy": "к", | |
"kfr": "𝔨", | |
"kgreen": "ĸ", | |
"khcy": "х", | |
"kjcy": "ќ", | |
"kopf": "𝕜", | |
"kscr": "𝓀", | |
"lAarr": "⇚", | |
"lArr": "⇐", | |
"lAtail": "⤛", | |
"lBarr": "⤎", | |
"lE": "≦", | |
"lEg": "⪋", | |
"lHar": "⥢", | |
"lacute": "ĺ", | |
"laemptyv": "⦴", | |
"lagran": "ℒ", | |
"lambda": "λ", | |
"lang": "⟨", | |
"langd": "⦑", | |
"langle": "⟨", | |
"lap": "⪅", | |
"laqu": "«", | |
"laquo": "«", | |
"larr": "←", | |
"larrb": "⇤", | |
"larrbfs": "⤟", | |
"larrfs": "⤝", | |
"larrhk": "↩", | |
"larrlp": "↫", | |
"larrpl": "⤹", | |
"larrsim": "⥳", | |
"larrtl": "↢", | |
"lat": "⪫", | |
"latail": "⤙", | |
"late": "⪭", | |
"lates": "⪭︀", | |
"lbarr": "⤌", | |
"lbbrk": "❲", | |
"lbrace": "{", | |
"lbrack": "[", | |
"lbrke": "⦋", | |
"lbrksld": "⦏", | |
"lbrkslu": "⦍", | |
"lcaron": "ľ", | |
"lcedil": "ļ", | |
"lceil": "⌈", | |
"lcub": "{", | |
"lcy": "л", | |
"ldca": "⤶", | |
"ldquo": "“", | |
"ldquor": "„", | |
"ldrdhar": "⥧", | |
"ldrushar": "⥋", | |
"ldsh": "↲", | |
"le": "≤", | |
"leftarrow": "←", | |
"leftarrowtail": "↢", | |
"leftharpoondown": "↽", | |
"leftharpoonup": "↼", | |
"leftleftarrows": "⇇", | |
"leftrightarrow": "↔", | |
"leftrightarrows": "⇆", | |
"leftrightharpoons": "⇋", | |
"leftrightsquigarrow": "↭", | |
"leftthreetimes": "⋋", | |
"leg": "⋚", | |
"leq": "≤", | |
"leqq": "≦", | |
"leqslant": "⩽", | |
"les": "⩽", | |
"lescc": "⪨", | |
"lesdot": "⩿", | |
"lesdoto": "⪁", | |
"lesdotor": "⪃", | |
"lesg": "⋚︀", | |
"lesges": "⪓", | |
"lessapprox": "⪅", | |
"lessdot": "⋖", | |
"lesseqgtr": "⋚", | |
"lesseqqgtr": "⪋", | |
"lessgtr": "≶", | |
"lesssim": "≲", | |
"lfisht": "⥼", | |
"lfloor": "⌊", | |
"lfr": "𝔩", | |
"lg": "≶", | |
"lgE": "⪑", | |
"lhard": "↽", | |
"lharu": "↼", | |
"lharul": "⥪", | |
"lhblk": "▄", | |
"ljcy": "љ", | |
"ll": "≪", | |
"llarr": "⇇", | |
"llcorner": "⌞", | |
"llhard": "⥫", | |
"lltri": "◺", | |
"lmidot": "ŀ", | |
"lmoust": "⎰", | |
"lmoustache": "⎰", | |
"lnE": "≨", | |
"lnap": "⪉", | |
"lnapprox": "⪉", | |
"lne": "⪇", | |
"lneq": "⪇", | |
"lneqq": "≨", | |
"lnsim": "⋦", | |
"loang": "⟬", | |
"loarr": "⇽", | |
"lobrk": "⟦", | |
"longleftarrow": "⟵", | |
"longleftrightarrow": "⟷", | |
"longmapsto": "⟼", | |
"longrightarrow": "⟶", | |
"looparrowleft": "↫", | |
"looparrowright": "↬", | |
"lopar": "⦅", | |
"lopf": "𝕝", | |
"loplus": "⨭", | |
"lotimes": "⨴", | |
"lowast": "∗", | |
"lowbar": "_", | |
"loz": "◊", | |
"lozenge": "◊", | |
"lozf": "⧫", | |
"lpar": "(", | |
"lparlt": "⦓", | |
"lrarr": "⇆", | |
"lrcorner": "⌟", | |
"lrhar": "⇋", | |
"lrhard": "⥭", | |
"lrm": "", | |
"lrtri": "⊿", | |
"lsaquo": "‹", | |
"lscr": "𝓁", | |
"lsh": "↰", | |
"lsim": "≲", | |
"lsime": "⪍", | |
"lsimg": "⪏", | |
"lsqb": "[", | |
"lsquo": "‘", | |
"lsquor": "‚", | |
"lstrok": "ł", | |
"l": "<", | |
"lt": "<", | |
"ltcc": "⪦", | |
"ltcir": "⩹", | |
"ltdot": "⋖", | |
"lthree": "⋋", | |
"ltimes": "⋉", | |
"ltlarr": "⥶", | |
"ltquest": "⩻", | |
"ltrPar": "⦖", | |
"ltri": "◃", | |
"ltrie": "⊴", | |
"ltrif": "◂", | |
"lurdshar": "⥊", | |
"luruhar": "⥦", | |
"lvertneqq": "≨︀", | |
"lvnE": "≨︀", | |
"mDDot": "∺", | |
"mac": "¯", | |
"macr": "¯", | |
"male": "♂", | |
"malt": "✠", | |
"maltese": "✠", | |
"map": "↦", | |
"mapsto": "↦", | |
"mapstodown": "↧", | |
"mapstoleft": "↤", | |
"mapstoup": "↥", | |
"marker": "▮", | |
"mcomma": "⨩", | |
"mcy": "м", | |
"mdash": "—", | |
"measuredangle": "∡", | |
"mfr": "𝔪", | |
"mho": "℧", | |
"micr": "µ", | |
"micro": "µ", | |
"mid": "∣", | |
"midast": "*", | |
"midcir": "⫰", | |
"middo": "·", | |
"middot": "·", | |
"minus": "−", | |
"minusb": "⊟", | |
"minusd": "∸", | |
"minusdu": "⨪", | |
"mlcp": "⫛", | |
"mldr": "…", | |
"mnplus": "∓", | |
"models": "⊧", | |
"mopf": "𝕞", | |
"mp": "∓", | |
"mscr": "𝓂", | |
"mstpos": "∾", | |
"mu": "μ", | |
"multimap": "⊸", | |
"mumap": "⊸", | |
"nGg": "⋙̸", | |
"nGt": "≫⃒", | |
"nGtv": "≫̸", | |
"nLeftarrow": "⇍", | |
"nLeftrightarrow": "⇎", | |
"nLl": "⋘̸", | |
"nLt": "≪⃒", | |
"nLtv": "≪̸", | |
"nRightarrow": "⇏", | |
"nVDash": "⊯", | |
"nVdash": "⊮", | |
"nabla": "∇", | |
"nacute": "ń", | |
"nang": "∠⃒", | |
"nap": "≉", | |
"napE": "⩰̸", | |
"napid": "≋̸", | |
"napos": "ʼn", | |
"napprox": "≉", | |
"natur": "♮", | |
"natural": "♮", | |
"naturals": "ℕ", | |
"nbs": " ", | |
"nbsp": " ", | |
"nbump": "≎̸", | |
"nbumpe": "≏̸", | |
"ncap": "⩃", | |
"ncaron": "ň", | |
"ncedil": "ņ", | |
"ncong": "≇", | |
"ncongdot": "⩭̸", | |
"ncup": "⩂", | |
"ncy": "н", | |
"ndash": "–", | |
"ne": "≠", | |
"neArr": "⇗", | |
"nearhk": "⤤", | |
"nearr": "↗", | |
"nearrow": "↗", | |
"nedot": "≐̸", | |
"nequiv": "≢", | |
"nesear": "⤨", | |
"nesim": "≂̸", | |
"nexist": "∄", | |
"nexists": "∄", | |
"nfr": "𝔫", | |
"ngE": "≧̸", | |
"nge": "≱", | |
"ngeq": "≱", | |
"ngeqq": "≧̸", | |
"ngeqslant": "⩾̸", | |
"nges": "⩾̸", | |
"ngsim": "≵", | |
"ngt": "≯", | |
"ngtr": "≯", | |
"nhArr": "⇎", | |
"nharr": "↮", | |
"nhpar": "⫲", | |
"ni": "∋", | |
"nis": "⋼", | |
"nisd": "⋺", | |
"niv": "∋", | |
"njcy": "њ", | |
"nlArr": "⇍", | |
"nlE": "≦̸", | |
"nlarr": "↚", | |
"nldr": "‥", | |
"nle": "≰", | |
"nleftarrow": "↚", | |
"nleftrightarrow": "↮", | |
"nleq": "≰", | |
"nleqq": "≦̸", | |
"nleqslant": "⩽̸", | |
"nles": "⩽̸", | |
"nless": "≮", | |
"nlsim": "≴", | |
"nlt": "≮", | |
"nltri": "⋪", | |
"nltrie": "⋬", | |
"nmid": "∤", | |
"nopf": "𝕟", | |
"no": "¬", | |
"not": "¬", | |
"notin": "∉", | |
"notinE": "⋹̸", | |
"notindot": "⋵̸", | |
"notinva": "∉", | |
"notinvb": "⋷", | |
"notinvc": "⋶", | |
"notni": "∌", | |
"notniva": "∌", | |
"notnivb": "⋾", | |
"notnivc": "⋽", | |
"npar": "∦", | |
"nparallel": "∦", | |
"nparsl": "⫽⃥", | |
"npart": "∂̸", | |
"npolint": "⨔", | |
"npr": "⊀", | |
"nprcue": "⋠", | |
"npre": "⪯̸", | |
"nprec": "⊀", | |
"npreceq": "⪯̸", | |
"nrArr": "⇏", | |
"nrarr": "↛", | |
"nrarrc": "⤳̸", | |
"nrarrw": "↝̸", | |
"nrightarrow": "↛", | |
"nrtri": "⋫", | |
"nrtrie": "⋭", | |
"nsc": "⊁", | |
"nsccue": "⋡", | |
"nsce": "⪰̸", | |
"nscr": "𝓃", | |
"nshortmid": "∤", | |
"nshortparallel": "∦", | |
"nsim": "≁", | |
"nsime": "≄", | |
"nsimeq": "≄", | |
"nsmid": "∤", | |
"nspar": "∦", | |
"nsqsube": "⋢", | |
"nsqsupe": "⋣", | |
"nsub": "⊄", | |
"nsubE": "⫅̸", | |
"nsube": "⊈", | |
"nsubset": "⊂⃒", | |
"nsubseteq": "⊈", | |
"nsubseteqq": "⫅̸", | |
"nsucc": "⊁", | |
"nsucceq": "⪰̸", | |
"nsup": "⊅", | |
"nsupE": "⫆̸", | |
"nsupe": "⊉", | |
"nsupset": "⊃⃒", | |
"nsupseteq": "⊉", | |
"nsupseteqq": "⫆̸", | |
"ntgl": "≹", | |
"ntild": "ñ", | |
"ntilde": "ñ", | |
"ntlg": "≸", | |
"ntriangleleft": "⋪", | |
"ntrianglelefteq": "⋬", | |
"ntriangleright": "⋫", | |
"ntrianglerighteq": "⋭", | |
"nu": "ν", | |
"num": "#", | |
"numero": "№", | |
"numsp": " ", | |
"nvDash": "⊭", | |
"nvHarr": "⤄", | |
"nvap": "≍⃒", | |
"nvdash": "⊬", | |
"nvge": "≥⃒", | |
"nvgt": ">⃒", | |
"nvinfin": "⧞", | |
"nvlArr": "⤂", | |
"nvle": "≤⃒", | |
"nvlt": "<⃒", | |
"nvltrie": "⊴⃒", | |
"nvrArr": "⤃", | |
"nvrtrie": "⊵⃒", | |
"nvsim": "∼⃒", | |
"nwArr": "⇖", | |
"nwarhk": "⤣", | |
"nwarr": "↖", | |
"nwarrow": "↖", | |
"nwnear": "⤧", | |
"oS": "Ⓢ", | |
"oacut": "ó", | |
"oacute": "ó", | |
"oast": "⊛", | |
"ocir": "ô", | |
"ocirc": "ô", | |
"ocy": "о", | |
"odash": "⊝", | |
"odblac": "ő", | |
"odiv": "⨸", | |
"odot": "⊙", | |
"odsold": "⦼", | |
"oelig": "œ", | |
"ofcir": "⦿", | |
"ofr": "𝔬", | |
"ogon": "˛", | |
"ograv": "ò", | |
"ograve": "ò", | |
"ogt": "⧁", | |
"ohbar": "⦵", | |
"ohm": "Ω", | |
"oint": "∮", | |
"olarr": "↺", | |
"olcir": "⦾", | |
"olcross": "⦻", | |
"oline": "‾", | |
"olt": "⧀", | |
"omacr": "ō", | |
"omega": "ω", | |
"omicron": "ο", | |
"omid": "⦶", | |
"ominus": "⊖", | |
"oopf": "𝕠", | |
"opar": "⦷", | |
"operp": "⦹", | |
"oplus": "⊕", | |
"or": "∨", | |
"orarr": "↻", | |
"ord": "º", | |
"order": "ℴ", | |
"orderof": "ℴ", | |
"ordf": "ª", | |
"ordm": "º", | |
"origof": "⊶", | |
"oror": "⩖", | |
"orslope": "⩗", | |
"orv": "⩛", | |
"oscr": "ℴ", | |
"oslas": "ø", | |
"oslash": "ø", | |
"osol": "⊘", | |
"otild": "õ", | |
"otilde": "õ", | |
"otimes": "⊗", | |
"otimesas": "⨶", | |
"oum": "ö", | |
"ouml": "ö", | |
"ovbar": "⌽", | |
"par": "¶", | |
"para": "¶", | |
"parallel": "∥", | |
"parsim": "⫳", | |
"parsl": "⫽", | |
"part": "∂", | |
"pcy": "п", | |
"percnt": "%", | |
"period": ".", | |
"permil": "‰", | |
"perp": "⊥", | |
"pertenk": "‱", | |
"pfr": "𝔭", | |
"phi": "φ", | |
"phiv": "ϕ", | |
"phmmat": "ℳ", | |
"phone": "☎", | |
"pi": "π", | |
"pitchfork": "⋔", | |
"piv": "ϖ", | |
"planck": "ℏ", | |
"planckh": "ℎ", | |
"plankv": "ℏ", | |
"plus": "+", | |
"plusacir": "⨣", | |
"plusb": "⊞", | |
"pluscir": "⨢", | |
"plusdo": "∔", | |
"plusdu": "⨥", | |
"pluse": "⩲", | |
"plusm": "±", | |
"plusmn": "±", | |
"plussim": "⨦", | |
"plustwo": "⨧", | |
"pm": "±", | |
"pointint": "⨕", | |
"popf": "𝕡", | |
"poun": "£", | |
"pound": "£", | |
"pr": "≺", | |
"prE": "⪳", | |
"prap": "⪷", | |
"prcue": "≼", | |
"pre": "⪯", | |
"prec": "≺", | |
"precapprox": "⪷", | |
"preccurlyeq": "≼", | |
"preceq": "⪯", | |
"precnapprox": "⪹", | |
"precneqq": "⪵", | |
"precnsim": "⋨", | |
"precsim": "≾", | |
"prime": "′", | |
"primes": "ℙ", | |
"prnE": "⪵", | |
"prnap": "⪹", | |
"prnsim": "⋨", | |
"prod": "∏", | |
"profalar": "⌮", | |
"profline": "⌒", | |
"profsurf": "⌓", | |
"prop": "∝", | |
"propto": "∝", | |
"prsim": "≾", | |
"prurel": "⊰", | |
"pscr": "𝓅", | |
"psi": "ψ", | |
"puncsp": " ", | |
"qfr": "𝔮", | |
"qint": "⨌", | |
"qopf": "𝕢", | |
"qprime": "⁗", | |
"qscr": "𝓆", | |
"quaternions": "ℍ", | |
"quatint": "⨖", | |
"quest": "?", | |
"questeq": "≟", | |
"quo": "\"", | |
"quot": "\"", | |
"rAarr": "⇛", | |
"rArr": "⇒", | |
"rAtail": "⤜", | |
"rBarr": "⤏", | |
"rHar": "⥤", | |
"race": "∽̱", | |
"racute": "ŕ", | |
"radic": "√", | |
"raemptyv": "⦳", | |
"rang": "⟩", | |
"rangd": "⦒", | |
"range": "⦥", | |
"rangle": "⟩", | |
"raqu": "»", | |
"raquo": "»", | |
"rarr": "→", | |
"rarrap": "⥵", | |
"rarrb": "⇥", | |
"rarrbfs": "⤠", | |
"rarrc": "⤳", | |
"rarrfs": "⤞", | |
"rarrhk": "↪", | |
"rarrlp": "↬", | |
"rarrpl": "⥅", | |
"rarrsim": "⥴", | |
"rarrtl": "↣", | |
"rarrw": "↝", | |
"ratail": "⤚", | |
"ratio": "∶", | |
"rationals": "ℚ", | |
"rbarr": "⤍", | |
"rbbrk": "❳", | |
"rbrace": "}", | |
"rbrack": "]", | |
"rbrke": "⦌", | |
"rbrksld": "⦎", | |
"rbrkslu": "⦐", | |
"rcaron": "ř", | |
"rcedil": "ŗ", | |
"rceil": "⌉", | |
"rcub": "}", | |
"rcy": "р", | |
"rdca": "⤷", | |
"rdldhar": "⥩", | |
"rdquo": "”", | |
"rdquor": "”", | |
"rdsh": "↳", | |
"real": "ℜ", | |
"realine": "ℛ", | |
"realpart": "ℜ", | |
"reals": "ℝ", | |
"rect": "▭", | |
"re": "®", | |
"reg": "®", | |
"rfisht": "⥽", | |
"rfloor": "⌋", | |
"rfr": "𝔯", | |
"rhard": "⇁", | |
"rharu": "⇀", | |
"rharul": "⥬", | |
"rho": "ρ", | |
"rhov": "ϱ", | |
"rightarrow": "→", | |
"rightarrowtail": "↣", | |
"rightharpoondown": "⇁", | |
"rightharpoonup": "⇀", | |
"rightleftarrows": "⇄", | |
"rightleftharpoons": "⇌", | |
"rightrightarrows": "⇉", | |
"rightsquigarrow": "↝", | |
"rightthreetimes": "⋌", | |
"ring": "˚", | |
"risingdotseq": "≓", | |
"rlarr": "⇄", | |
"rlhar": "⇌", | |
"rlm": "", | |
"rmoust": "⎱", | |
"rmoustache": "⎱", | |
"rnmid": "⫮", | |
"roang": "⟭", | |
"roarr": "⇾", | |
"robrk": "⟧", | |
"ropar": "⦆", | |
"ropf": "𝕣", | |
"roplus": "⨮", | |
"rotimes": "⨵", | |
"rpar": ")", | |
"rpargt": "⦔", | |
"rppolint": "⨒", | |
"rrarr": "⇉", | |
"rsaquo": "›", | |
"rscr": "𝓇", | |
"rsh": "↱", | |
"rsqb": "]", | |
"rsquo": "’", | |
"rsquor": "’", | |
"rthree": "⋌", | |
"rtimes": "⋊", | |
"rtri": "▹", | |
"rtrie": "⊵", | |
"rtrif": "▸", | |
"rtriltri": "⧎", | |
"ruluhar": "⥨", | |
"rx": "℞", | |
"sacute": "ś", | |
"sbquo": "‚", | |
"sc": "≻", | |
"scE": "⪴", | |
"scap": "⪸", | |
"scaron": "š", | |
"sccue": "≽", | |
"sce": "⪰", | |
"scedil": "ş", | |
"scirc": "ŝ", | |
"scnE": "⪶", | |
"scnap": "⪺", | |
"scnsim": "⋩", | |
"scpolint": "⨓", | |
"scsim": "≿", | |
"scy": "с", | |
"sdot": "⋅", | |
"sdotb": "⊡", | |
"sdote": "⩦", | |
"seArr": "⇘", | |
"searhk": "⤥", | |
"searr": "↘", | |
"searrow": "↘", | |
"sec": "§", | |
"sect": "§", | |
"semi": ";", | |
"seswar": "⤩", | |
"setminus": "∖", | |
"setmn": "∖", | |
"sext": "✶", | |
"sfr": "𝔰", | |
"sfrown": "⌢", | |
"sharp": "♯", | |
"shchcy": "щ", | |
"shcy": "ш", | |
"shortmid": "∣", | |
"shortparallel": "∥", | |
"sh": "", | |
"shy": "", | |
"sigma": "σ", | |
"sigmaf": "ς", | |
"sigmav": "ς", | |
"sim": "∼", | |
"simdot": "⩪", | |
"sime": "≃", | |
"simeq": "≃", | |
"simg": "⪞", | |
"simgE": "⪠", | |
"siml": "⪝", | |
"simlE": "⪟", | |
"simne": "≆", | |
"simplus": "⨤", | |
"simrarr": "⥲", | |
"slarr": "←", | |
"smallsetminus": "∖", | |
"smashp": "⨳", | |
"smeparsl": "⧤", | |
"smid": "∣", | |
"smile": "⌣", | |
"smt": "⪪", | |
"smte": "⪬", | |
"smtes": "⪬︀", | |
"softcy": "ь", | |
"sol": "/", | |
"solb": "⧄", | |
"solbar": "⌿", | |
"sopf": "𝕤", | |
"spades": "♠", | |
"spadesuit": "♠", | |
"spar": "∥", | |
"sqcap": "⊓", | |
"sqcaps": "⊓︀", | |
"sqcup": "⊔", | |
"sqcups": "⊔︀", | |
"sqsub": "⊏", | |
"sqsube": "⊑", | |
"sqsubset": "⊏", | |
"sqsubseteq": "⊑", | |
"sqsup": "⊐", | |
"sqsupe": "⊒", | |
"sqsupset": "⊐", | |
"sqsupseteq": "⊒", | |
"squ": "□", | |
"square": "□", | |
"squarf": "▪", | |
"squf": "▪", | |
"srarr": "→", | |
"sscr": "𝓈", | |
"ssetmn": "∖", | |
"ssmile": "⌣", | |
"sstarf": "⋆", | |
"star": "☆", | |
"starf": "★", | |
"straightepsilon": "ϵ", | |
"straightphi": "ϕ", | |
"strns": "¯", | |
"sub": "⊂", | |
"subE": "⫅", | |
"subdot": "⪽", | |
"sube": "⊆", | |
"subedot": "⫃", | |
"submult": "⫁", | |
"subnE": "⫋", | |
"subne": "⊊", | |
"subplus": "⪿", | |
"subrarr": "⥹", | |
"subset": "⊂", | |
"subseteq": "⊆", | |
"subseteqq": "⫅", | |
"subsetneq": "⊊", | |
"subsetneqq": "⫋", | |
"subsim": "⫇", | |
"subsub": "⫕", | |
"subsup": "⫓", | |
"succ": "≻", | |
"succapprox": "⪸", | |
"succcurlyeq": "≽", | |
"succeq": "⪰", | |
"succnapprox": "⪺", | |
"succneqq": "⪶", | |
"succnsim": "⋩", | |
"succsim": "≿", | |
"sum": "∑", | |
"sung": "♪", | |
"sup": "⊃", | |
"sup1": "¹", | |
"sup2": "²", | |
"sup3": "³", | |
"supE": "⫆", | |
"supdot": "⪾", | |
"supdsub": "⫘", | |
"supe": "⊇", | |
"supedot": "⫄", | |
"suphsol": "⟉", | |
"suphsub": "⫗", | |
"suplarr": "⥻", | |
"supmult": "⫂", | |
"supnE": "⫌", | |
"supne": "⊋", | |
"supplus": "⫀", | |
"supset": "⊃", | |
"supseteq": "⊇", | |
"supseteqq": "⫆", | |
"supsetneq": "⊋", | |
"supsetneqq": "⫌", | |
"supsim": "⫈", | |
"supsub": "⫔", | |
"supsup": "⫖", | |
"swArr": "⇙", | |
"swarhk": "⤦", | |
"swarr": "↙", | |
"swarrow": "↙", | |
"swnwar": "⤪", | |
"szli": "ß", | |
"szlig": "ß", | |
"target": "⌖", | |
"tau": "τ", | |
"tbrk": "⎴", | |
"tcaron": "ť", | |
"tcedil": "ţ", | |
"tcy": "т", | |
"tdot": "⃛", | |
"telrec": "⌕", | |
"tfr": "𝔱", | |
"there4": "∴", | |
"therefore": "∴", | |
"theta": "θ", | |
"thetasym": "ϑ", | |
"thetav": "ϑ", | |
"thickapprox": "≈", | |
"thicksim": "∼", | |
"thinsp": " ", | |
"thkap": "≈", | |
"thksim": "∼", | |
"thor": "þ", | |
"thorn": "þ", | |
"tilde": "˜", | |
"time": "×", | |
"times": "×", | |
"timesb": "⊠", | |
"timesbar": "⨱", | |
"timesd": "⨰", | |
"tint": "∭", | |
"toea": "⤨", | |
"top": "⊤", | |
"topbot": "⌶", | |
"topcir": "⫱", | |
"topf": "𝕥", | |
"topfork": "⫚", | |
"tosa": "⤩", | |
"tprime": "‴", | |
"trade": "™", | |
"triangle": "▵", | |
"triangledown": "▿", | |
"triangleleft": "◃", | |
"trianglelefteq": "⊴", | |
"triangleq": "≜", | |
"triangleright": "▹", | |
"trianglerighteq": "⊵", | |
"tridot": "◬", | |
"trie": "≜", | |
"triminus": "⨺", | |
"triplus": "⨹", | |
"trisb": "⧍", | |
"tritime": "⨻", | |
"trpezium": "⏢", | |
"tscr": "𝓉", | |
"tscy": "ц", | |
"tshcy": "ћ", | |
"tstrok": "ŧ", | |
"twixt": "≬", | |
"twoheadleftarrow": "↞", | |
"twoheadrightarrow": "↠", | |
"uArr": "⇑", | |
"uHar": "⥣", | |
"uacut": "ú", | |
"uacute": "ú", | |
"uarr": "↑", | |
"ubrcy": "ў", | |
"ubreve": "ŭ", | |
"ucir": "û", | |
"ucirc": "û", | |
"ucy": "у", | |
"udarr": "⇅", | |
"udblac": "ű", | |
"udhar": "⥮", | |
"ufisht": "⥾", | |
"ufr": "𝔲", | |
"ugrav": "ù", | |
"ugrave": "ù", | |
"uharl": "↿", | |
"uharr": "↾", | |
"uhblk": "▀", | |
"ulcorn": "⌜", | |
"ulcorner": "⌜", | |
"ulcrop": "⌏", | |
"ultri": "◸", | |
"umacr": "ū", | |
"um": "¨", | |
"uml": "¨", | |
"uogon": "ų", | |
"uopf": "𝕦", | |
"uparrow": "↑", | |
"updownarrow": "↕", | |
"upharpoonleft": "↿", | |
"upharpoonright": "↾", | |
"uplus": "⊎", | |
"upsi": "υ", | |
"upsih": "ϒ", | |
"upsilon": "υ", | |
"upuparrows": "⇈", | |
"urcorn": "⌝", | |
"urcorner": "⌝", | |
"urcrop": "⌎", | |
"uring": "ů", | |
"urtri": "◹", | |
"uscr": "𝓊", | |
"utdot": "⋰", | |
"utilde": "ũ", | |
"utri": "▵", | |
"utrif": "▴", | |
"uuarr": "⇈", | |
"uum": "ü", | |
"uuml": "ü", | |
"uwangle": "⦧", | |
"vArr": "⇕", | |
"vBar": "⫨", | |
"vBarv": "⫩", | |
"vDash": "⊨", | |
"vangrt": "⦜", | |
"varepsilon": "ϵ", | |
"varkappa": "ϰ", | |
"varnothing": "∅", | |
"varphi": "ϕ", | |
"varpi": "ϖ", | |
"varpropto": "∝", | |
"varr": "↕", | |
"varrho": "ϱ", | |
"varsigma": "ς", | |
"varsubsetneq": "⊊︀", | |
"varsubsetneqq": "⫋︀", | |
"varsupsetneq": "⊋︀", | |
"varsupsetneqq": "⫌︀", | |
"vartheta": "ϑ", | |
"vartriangleleft": "⊲", | |
"vartriangleright": "⊳", | |
"vcy": "в", | |
"vdash": "⊢", | |
"vee": "∨", | |
"veebar": "⊻", | |
"veeeq": "≚", | |
"vellip": "⋮", | |
"verbar": "|", | |
"vert": "|", | |
"vfr": "𝔳", | |
"vltri": "⊲", | |
"vnsub": "⊂⃒", | |
"vnsup": "⊃⃒", | |
"vopf": "𝕧", | |
"vprop": "∝", | |
"vrtri": "⊳", | |
"vscr": "𝓋", | |
"vsubnE": "⫋︀", | |
"vsubne": "⊊︀", | |
"vsupnE": "⫌︀", | |
"vsupne": "⊋︀", | |
"vzigzag": "⦚", | |
"wcirc": "ŵ", | |
"wedbar": "⩟", | |
"wedge": "∧", | |
"wedgeq": "≙", | |
"weierp": "℘", | |
"wfr": "𝔴", | |
"wopf": "𝕨", | |
"wp": "℘", | |
"wr": "≀", | |
"wreath": "≀", | |
"wscr": "𝓌", | |
"xcap": "⋂", | |
"xcirc": "◯", | |
"xcup": "⋃", | |
"xdtri": "▽", | |
"xfr": "𝔵", | |
"xhArr": "⟺", | |
"xharr": "⟷", | |
"xi": "ξ", | |
"xlArr": "⟸", | |
"xlarr": "⟵", | |
"xmap": "⟼", | |
"xnis": "⋻", | |
"xodot": "⨀", | |
"xopf": "𝕩", | |
"xoplus": "⨁", | |
"xotime": "⨂", | |
"xrArr": "⟹", | |
"xrarr": "⟶", | |
"xscr": "𝓍", | |
"xsqcup": "⨆", | |
"xuplus": "⨄", | |
"xutri": "△", | |
"xvee": "⋁", | |
"xwedge": "⋀", | |
"yacut": "ý", | |
"yacute": "ý", | |
"yacy": "я", | |
"ycirc": "ŷ", | |
"ycy": "ы", | |
"ye": "¥", | |
"yen": "¥", | |
"yfr": "𝔶", | |
"yicy": "ї", | |
"yopf": "𝕪", | |
"yscr": "𝓎", | |
"yucy": "ю", | |
"yum": "ÿ", | |
"yuml": "ÿ", | |
"zacute": "ź", | |
"zcaron": "ž", | |
"zcy": "з", | |
"zdot": "ż", | |
"zeetrf": "ℨ", | |
"zeta": "ζ", | |
"zfr": "𝔷", | |
"zhcy": "ж", | |
"zigrarr": "⇝", | |
"zopf": "𝕫", | |
"zscr": "𝓏", | |
"zwj": "", | |
"zwnj": "" | |
} | |
},{}],57:[function(require,module,exports){ | |
module.exports={ | |
"0": "�", | |
"128": "€", | |
"130": "‚", | |
"131": "ƒ", | |
"132": "„", | |
"133": "…", | |
"134": "†", | |
"135": "‡", | |
"136": "ˆ", | |
"137": "‰", | |
"138": "Š", | |
"139": "‹", | |
"140": "Œ", | |
"142": "Ž", | |
"145": "‘", | |
"146": "’", | |
"147": "“", | |
"148": "”", | |
"149": "•", | |
"150": "–", | |
"151": "—", | |
"152": "˜", | |
"153": "™", | |
"154": "š", | |
"155": "›", | |
"156": "œ", | |
"158": "ž", | |
"159": "Ÿ" | |
} | |
},{}],58:[function(require,module,exports){ | |
'use strict'; | |
var alphabetical = require('is-alphabetical'); | |
var decimal = require('is-decimal'); | |
module.exports = alphanumerical; | |
/* Check if the given character code, or the character | |
* code at the first character, is alphanumerical. */ | |
function alphanumerical(character) { | |
return alphabetical(character) || decimal(character); | |
} | |
},{"is-alphabetical":49,"is-decimal":50}],59:[function(require,module,exports){ | |
'use strict'; | |
module.exports = hexadecimal; | |
/* Check if the given character code, or the character | |
* code at the first character, is hexadecimal. */ | |
function hexadecimal(character) { | |
var code = typeof character === 'string' ? | |
character.charCodeAt(0) : character; | |
return (code >= 97 /* a */ && code <= 102 /* z */) || | |
(code >= 65 /* A */ && code <= 70 /* Z */) || | |
(code >= 48 /* A */ && code <= 57 /* Z */); | |
} | |
},{}],60:[function(require,module,exports){ | |
/*! | |
* repeat-string <https://github.com/jonschlinkert/repeat-string> | |
* | |
* Copyright (c) 2014-2015, Jon Schlinkert. | |
* Licensed under the MIT License. | |
*/ | |
'use strict'; | |
/** | |
* Results cache | |
*/ | |
var res = ''; | |
var cache; | |
/** | |
* Expose `repeat` | |
*/ | |
module.exports = repeat; | |
/** | |
* Repeat the given `string` the specified `number` | |
* of times. | |
* | |
* **Example:** | |
* | |
* ```js | |
* var repeat = require('repeat-string'); | |
* repeat('A', 5); | |
* //=> AAAAA | |
* ``` | |
* | |
* @param {String} `string` The string to repeat | |
* @param {Number} `number` The number of times to repeat the string | |
* @return {String} Repeated string | |
* @api public | |
*/ | |
function repeat(str, num) { | |
if (typeof str !== 'string') { | |
throw new TypeError('expected a string'); | |
} | |
// cover common, quick use cases | |
if (num === 1) return str; | |
if (num === 2) return str + str; | |
var max = str.length * num; | |
if (cache !== str || typeof cache === 'undefined') { | |
cache = str; | |
res = ''; | |
} else if (res.length >= max) { | |
return res.substr(0, max); | |
} | |
while (max > res.length && num > 1) { | |
if (num & 1) { | |
res += str; | |
} | |
num >>= 1; | |
str += str; | |
} | |
res += str; | |
res = res.substr(0, max); | |
return res; | |
} | |
},{}],61:[function(require,module,exports){ | |
/** | |
* @author Titus Wormer | |
* @copyright 2016 Titus Wormer | |
* @license MIT | |
* @module state-toggle | |
* @fileoverview Enter/exit a state. | |
*/ | |
'use strict'; | |
/* eslint-env commonjs */ | |
/* Expose. */ | |
module.exports = factory; | |
/** | |
* Construct a state `toggler`: a function which inverses | |
* `property` in context based on its current value. | |
* The by `toggler` returned function restores that value. | |
* | |
* @param {string} key - Property to toggle. | |
* @param {boolean} state - Default state. | |
* @param {Object?} [ctx] - Context object. | |
* @return {Function} - Enter. | |
*/ | |
function factory(key, state, ctx) { | |
/** | |
* Enter a state. | |
* | |
* @return {Function} - Exit state. | |
*/ | |
return function () { | |
var context = ctx || this; | |
var current = context[key]; | |
context[key] = !state; | |
/** | |
* Cancel state to its value before entering. | |
*/ | |
return function () { | |
context[key] = current; | |
}; | |
}; | |
} | |
},{}],62:[function(require,module,exports){ | |
'use strict'; | |
module.exports = trimTrailingLines; | |
var line = '\n'; | |
/* Remove final newline characters from `value`. */ | |
function trimTrailingLines(value) { | |
var val = String(value); | |
var index = val.length; | |
while (val.charAt(--index) === line) { /* empty */ } | |
return val.slice(0, index + 1); | |
} | |
},{}],63:[function(require,module,exports){ | |
exports = module.exports = trim; | |
function trim(str){ | |
return str.replace(/^\s*|\s*$/g, ''); | |
} | |
exports.left = function(str){ | |
return str.replace(/^\s*/, ''); | |
}; | |
exports.right = function(str){ | |
return str.replace(/\s*$/, ''); | |
}; | |
},{}],64:[function(require,module,exports){ | |
/** | |
* @author Titus Wormer | |
* @copyright 2015 Titus Wormer | |
* @license MIT | |
* @module unherit | |
* @fileoverview Create a custom constructor which can be modified | |
* without affecting the original class. | |
*/ | |
'use strict'; | |
/* Dependencies. */ | |
var xtend = require('xtend'); | |
var inherits = require('inherits'); | |
/* Expose. */ | |
module.exports = unherit; | |
/** | |
* Create a custom constructor which can be modified | |
* without affecting the original class. | |
* | |
* @param {Function} Super - Super-class. | |
* @return {Function} - Constructor acting like `Super`, | |
* which can be modified without affecting the original | |
* class. | |
*/ | |
function unherit(Super) { | |
var result; | |
var key; | |
var value; | |
inherits(Of, Super); | |
inherits(From, Of); | |
/* Clone values. */ | |
result = Of.prototype; | |
for (key in result) { | |
value = result[key]; | |
if (value && typeof value === 'object') { | |
result[key] = 'concat' in value ? value.concat() : xtend(value); | |
} | |
} | |
return Of; | |
/** | |
* Constructor accepting a single argument, | |
* which itself is an `arguments` object. | |
*/ | |
function From(parameters) { | |
return Super.apply(this, parameters); | |
} | |
/** | |
* Constructor accepting variadic arguments. | |
*/ | |
function Of() { | |
if (!(this instanceof Of)) { | |
return new From(arguments); | |
} | |
return Super.apply(this, arguments); | |
} | |
} | |
},{"inherits":65,"xtend":69}],65:[function(require,module,exports){ | |
if (typeof Object.create === 'function') { | |
// implementation from standard node.js 'util' module | |
module.exports = function inherits(ctor, superCtor) { | |
ctor.super_ = superCtor | |
ctor.prototype = Object.create(superCtor.prototype, { | |
constructor: { | |
value: ctor, | |
enumerable: false, | |
writable: true, | |
configurable: true | |
} | |
}); | |
}; | |
} else { | |
// old school shim for old browsers | |
module.exports = function inherits(ctor, superCtor) { | |
ctor.super_ = superCtor | |
var TempCtor = function () {} | |
TempCtor.prototype = superCtor.prototype | |
ctor.prototype = new TempCtor() | |
ctor.prototype.constructor = ctor | |
} | |
} | |
},{}],66:[function(require,module,exports){ | |
'use strict'; | |
var visit = require('unist-util-visit'); | |
module.exports = removePosition; | |
/* Remove `position`s from `tree`. */ | |
function removePosition(node, force) { | |
visit(node, force ? hard : soft); | |
return node; | |
} | |
function hard(node) { | |
delete node.position; | |
} | |
function soft(node) { | |
node.position = undefined; | |
} | |
},{"unist-util-visit":67}],67:[function(require,module,exports){ | |
'use strict'; | |
/* Expose. */ | |
module.exports = visit; | |
/* Visit. */ | |
function visit(tree, type, visitor, reverse) { | |
if (typeof type === 'function') { | |
reverse = visitor; | |
visitor = type; | |
type = null; | |
} | |
one(tree); | |
/* Visit a single node. */ | |
function one(node, index, parent) { | |
var result; | |
index = index || (parent ? 0 : null); | |
if (!type || node.type === type) { | |
result = visitor(node, index, parent || null); | |
} | |
if (node.children && result !== false) { | |
return all(node.children, node); | |
} | |
return result; | |
} | |
/* Visit children in `parent`. */ | |
function all(children, parent) { | |
var step = reverse ? -1 : 1; | |
var max = children.length; | |
var min = -1; | |
var index = (reverse ? max : min) + step; | |
var child; | |
while (index > min && index < max) { | |
child = children[index]; | |
if (child && one(child, index, parent) === false) { | |
return false; | |
} | |
index += step; | |
} | |
return true; | |
} | |
} | |
},{}],68:[function(require,module,exports){ | |
'use strict'; | |
/* Expose. */ | |
module.exports = factory; | |
/* Factory. */ | |
function factory(file) { | |
var contents = indices(String(file)); | |
return { | |
toPosition: offsetToPositionFactory(contents), | |
toOffset: positionToOffsetFactory(contents) | |
}; | |
} | |
/* Factory to get the line and column-based `position` for | |
* `offset` in the bound indices. */ | |
function offsetToPositionFactory(indices) { | |
return offsetToPosition; | |
/* Get the line and column-based `position` for | |
* `offset` in the bound indices. */ | |
function offsetToPosition(offset) { | |
var index = -1; | |
var length = indices.length; | |
if (offset < 0) { | |
return {}; | |
} | |
while (++index < length) { | |
if (indices[index] > offset) { | |
return { | |
line: index + 1, | |
column: (offset - (indices[index - 1] || 0)) + 1, | |
offset: offset | |
}; | |
} | |
} | |
return {}; | |
} | |
} | |
/* Factory to get the `offset` for a line and column-based | |
* `position` in the bound indices. */ | |
function positionToOffsetFactory(indices) { | |
return positionToOffset; | |
/* Get the `offset` for a line and column-based | |
* `position` in the bound indices. */ | |
function positionToOffset(position) { | |
var line = position && position.line; | |
var column = position && position.column; | |
if (!isNaN(line) && !isNaN(column) && line - 1 in indices) { | |
return ((indices[line - 2] || 0) + column - 1) || 0; | |
} | |
return -1; | |
} | |
} | |
/* Get indices of line-breaks in `value`. */ | |
function indices(value) { | |
var result = []; | |
var index = value.indexOf('\n'); | |
while (index !== -1) { | |
result.push(index + 1); | |
index = value.indexOf('\n', index + 1); | |
} | |
result.push(value.length + 1); | |
return result; | |
} | |
},{}],69:[function(require,module,exports){ | |
module.exports = extend | |
var hasOwnProperty = Object.prototype.hasOwnProperty; | |
function extend() { | |
var target = {} | |
for (var i = 0; i < arguments.length; i++) { | |
var source = arguments[i] | |
for (var key in source) { | |
if (hasOwnProperty.call(source, key)) { | |
target[key] = source[key] | |
} | |
} | |
} | |
return target | |
} | |
},{}],"remark-parse":[function(require,module,exports){ | |
'use strict'; | |
var unherit = require('unherit'); | |
var xtend = require('xtend'); | |
var Parser = require('./lib/parser.js'); | |
module.exports = parse; | |
parse.Parser = Parser; | |
function parse(options) { | |
var Local = unherit(Parser); | |
Local.prototype.options = xtend(Local.prototype.options, this.data('settings'), options); | |
this.Parser = Local; | |
} | |
},{"./lib/parser.js":14,"unherit":64,"xtend":69}]},{},[]) | |
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2hvbWUvYWRtaW4vYnJvd3NlcmlmeS1jZG4vbm9kZV9tb2R1bGVzL2Jyb3dzZXJpZnkvbm9kZV9tb2R1bGVzL2Jyb3dzZXItcGFjay9fcHJlbHVkZS5qcyIsImxpYi9ibG9jay1lbGVtZW50cy5qc29uIiwibGliL2RlY29kZS5qcyIsImxpYi9kZWZhdWx0cy5qcyIsImxpYi9sb2NhdGUvYnJlYWsuanMiLCJsaWIvbG9jYXRlL2NvZGUtaW5saW5lLmpzIiwibGliL2xvY2F0ZS9kZWxldGUuanMiLCJsaWIvbG9jYXRlL2VtcGhhc2lzLmpzIiwibGliL2xvY2F0ZS9lc2NhcGUuanMiLCJsaWIvbG9jYXRlL2xpbmsuanMiLCJsaWIvbG9jYXRlL3N0cm9uZy5qcyIsImxpYi9sb2NhdGUvdGFnLmpzIiwibGliL2xvY2F0ZS91cmwuanMi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G4gICAgICB9XG5cbiAgICAgIGlmIChzdWJxdWV1ZS5sZW5ndGggPT09IDApIHtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG5cbiAgICAgIHF1ZXVlICs9IHN1YnF1ZXVlO1xuICAgIH1cblxuICAgIGlmIChxdWV1ZSkge1xuICAgICAgY29udGVudCArPSBxdWV1ZTtcbiAgICAgIHF1ZXVlID0gJyc7XG4gICAgfVxuXG4gICAgY29udGVudCArPSBjaGFyYWN0ZXI7XG4gICAgaW5kZXgrKztcbiAgfVxuXG4gIHN1YnZhbHVlICs9IGNvbnRlbnQ7XG5cbiAgY29udGVudCA9IGNvbnRlbnQucmVwbGFjZShFWFBSRVNTSU9OX0lOSVRJQUxfVEFCLCBmdW5jdGlvbiAobGluZSkge1xuICAgIG9mZnNldHNbY3VycmVudExpbmVdID0gKG9mZnNldHNbY3VycmVudExpbmVdIHx8IDApICsgbGluZS5sZW5ndGg7XG4gICAgY3VycmVudExpbmUrKztcblxuICAgIHJldHVybiAnJztcbiAgfSk7XG5cbiAgYWRkID0gZWF0KHN1YnZhbHVlKTtcblxuICBleGl0ID0gc2VsZi5lbnRlckJsb2NrKCk7XG4gIGNvbnRlbnQgPSBzZWxmLnRva2VuaXplQmxvY2soY29udGVudCwgbm93KTtcbiAgZXhpdCgpO1xuXG4gIHJldHVybiBhZGQoe1xuICAgIHR5cGU6ICdmb290bm90ZURlZmluaXRpb24nLFxuICAgIGlkZW50aWZpZXI6IGlkZW50aWZpZXIsXG4gICAgY2hpbGRyZW46IGNvbnRlbnRcbiAgfSk7XG59XG4iLCIndXNlIHN0cmljdCc7XG5cbm1vZHVsZS5leHBvcnRzID0gYXR4SGVhZGluZztcblxudmFyIENfTkVXTElORSA9ICdcXG4nO1xudmFyIENfVEFCID0gJ1xcdCc7XG52YXIgQ19TUEFDRSA9ICcgJztcbnZhciBDX0hBU0ggPSAnIyc7XG5cbnZhciBNQVhfQVRYX0NPVU5UID0gNjtcblxuZnVuY3Rpb24gYXR4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ckF0KGluZGV4KTtcbiAgICBzdWJxdWV1ZSA9IGNoYXJhY3RlcjtcblxuICAgIGlmIChjaGFyYWN0ZXIgPT09IENfVElDSykge1xuICAgICAgLyogSW5saW5lLWNvZGUgaW4gbGluayBjb250ZW50LiAqL1xuICAgICAgY291bnQgPSAxO1xuXG4gICAgICB3aGlsZSAodmFsdWUuY2hhckF0KGluZGV4ICsgMSkgPT09IENfVElDSykge1xuICAgICAgICBzdWJxdWV1ZSArPSBjaGFyYWN0ZXI7XG4gICAgICAgIGluZGV4Kys7XG4gICAgICAgIGNvdW50Kys7XG4gICAgICB9XG5cbiAgICAgIGlmICghb3BlbmluZykge1xuICAgICAgICBvcGVuaW5nID0gY291bnQ7XG4gICAgICB9IGVsc2UgaWYgKGNvdW50ID49IG9wZW5pbmcpIHtcbiAgICAgICAgb3BlbmluZyA9IDA7XG4gICAgICB9XG4gICAgfSBlbHNlIGlmIChjaGFyYWN0ZXIgPT09IENfQkFDS1NMQVNIKSB7XG4gICAgICAvKiBBbGxvdyBicmFja2V0cyB0byBiZSBlc2NhcGVkLiAqL1xuICAgICAgaW5kZXgrKztcbiAgICAgIHN1YnF1ZXVlICs9IHZhbHVlLmNoYXJBdChpbmRleCk7XG4gICAgLyogSW4gR0ZNIG1vZGUsIGJyYWNrZXRzIGluIGNvZGUgc3RpbGwgY291bnQuXG4gICAgICogSW4gYWxsIG90aGVyIG1vZGVzLCB0aGV5IGRvbuKAmXQuICBUaGlzIGVtcHR5XG4gICAgICogYmxvY2sgcHJldmVudHMgdGhlIG5leHQgc3RhdGVtZW50cyBhcmVcbiAgICAgKiBlbnRlcmVkLiAqL1xuICAgIH0gZWxzZSBpZiAoKCFvcGVuaW5nIHx8IGdmbSkgJiYgY2hhcmFjdGVyID09PSBDX0JSQUNLRVRfT1BFTikge1xuICAgICAgZGVwdGgrKztcbiAgICB9IGVsc2UgaWYgKCghb3BlbmluZyB8fCBnZm0pICYmIGNoYXJhY3RlciA9PT0gQ19CUkFDS0VUX0NMT1NFKSB7XG4gICAgICBpZiAoZGVwdGgpIHtcbiAgICAgICAgZGVwdGgtLTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIC8qIEFsbG93IHdoaXRlLXNwYWNlIGJldHdlZW4gY29udGVudCBhbmRcbiAgICAgICAgICogdXJsIGluIEdGTSBtb2RlLiAqL1xuICAgICAgICBpZiAoIXBlZGFudGljKSB7XG4gICAgICAgICAgd2hpbGUgKGluZGV4IDwgbGVuZ3RoKSB7XG4gICAgICAgICAgICBjaGFyYWN0ZXIgPSB2YWx1ZS5jaGFyQXQoaW5kZXggKyAxKTtcblxuICAgICAgICAgICAgaWYgKCF3aGl0ZXNwYWNlKGNoYXJhY3RlcikpIHtcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHN1YnF1ZXVlICs9IGNoYXJhY3RlcjtcbiAgICAgICAgICAgIGluZGV4Kys7XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHZhbHVlLmNoYXJBdChpbmRleCArIDEpICE9PSBDX1BBUkVOX09QRU4pIHtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBzdWJxdWV1ZSArPSBDX1BBUkVOX09QRU47XG4gICAgICAgIGNsb3NlZCA9IHRydWU7XG4gICAgICAgIGluZGV4Kys7XG5cbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgfVxuXG4gICAgcXVldWUgKz0gc3VicXVldWU7XG4gICAgc3VicXVldWUgPSAnJztcbiAgICBpbmRleCsrO1xuICB9XG5cbiAgLyogRWF0IHRoZSBjb250ZW50IGNsb3NpbmcuICovXG4gIGlmICghY2xvc2VkKSB7XG4gICAgcmV0dXJuO1xuICB9XG5cbiAgY29udGVudCA9IHF1ZXVlO1xuICBzdWJ2YWx1ZSArPSBxdWV1ZSArIHN1YnF1ZXVlO1xuICBpbmRleCsrO1xuXG4gIC8qIEVhdCB3aGl0ZS1z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WFya2VyKSB7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoY2hhcmFjdGVyID09PSBDX0JBQ0tTTEFTSCkge1xuICAgICAgICAgIHF1ZXVlICs9IENfQkFDS1NMQVNIO1xuICAgICAgICAgIGNoYXJhY3RlciA9IHZhbHVlLmNoYXJBdCgrK2luZGV4KTtcbiAgICAgICAgfVxuXG4gICAgICAgIGluZGV4Kys7XG4gICAgICAgIHF1ZXVlICs9IGNoYXJhY3RlcjtcbiAgICAgIH1cblxuICAgICAgY2hhcmFjdGVyID0gdmFsdWUuY2hhckF0KGluZGV4KTtcblxuICAgICAgaWYgKGNoYXJhY3RlciAhPT0gbWFya2VyKSB7XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cblxuICAgICAgdGl0bGUgPSBxdWV1ZTtcbiAgICAgIHN1YnZhbHVlICs9IHF1ZXVlICsgY2hhcmFjdGVyO1xuICAgICAgaW5kZXgrKztcblxuICAgICAgd2hpbGUgKGluZGV4IDwgbGVuZ3RoKSB7XG4gICAgICAgIGNoYXJhY3RlciA9IHZhbHVlLmNoYXJBdChpbmRleCk7XG5cbiAgICAgICAgaWYgKCF3aGl0ZXNwYWNlKGNoYXJhY3RlcikpIHtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuXG4gICAgICAgIHN1YnZhbHVlICs9IGNoYXJhY3RlcjtcbiAgICAgICAgaW5kZXgrKztcbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgc3VicXVldWUgPSAnJztcblxuICAgICAgd2hpbGUgKGluZGV4IDwgbGVuZ3RoKSB7XG4gICAgICAgIGNoYXJhY3RlciA9IHZhbHVlLmNoYXJBdChpbmRleCk7XG5cbiAgICAgICAgaWYgKGNoYXJhY3RlciA9PT0gbWFya2VyKSB7XG4gICAgICAgICAgaWYgKGhhc01hcmtlcikge1xuICAgICAgICAgICAgcXVldWUgKz0gbWFya2VyICsgc3VicXVldWU7XG4gICAgICAgICAgIC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YWs7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgcXVldWUgKz0gY2hhcmFjdGVyO1xuICAgICAgICAgIGluZGV4Kys7XG4gICAgICAgIH1cblxuICAgICAgICBjaGFyYWN0ZXIgPSB2YWx1ZS5jaGFyQXQoaW5kZXgpO1xuICAgICAgICBpbmRleCsrO1xuXG4gICAgICAgIGlmIChxdWV1ZSAmJiBtYXJrZXJzW2NoYXJhY3Rlcl0gPT09IHRydWUpIHtcbiAgICAgICAgICBjdXJyZW50TWFya2VyID0gY2hhcmFjdGVyO1xuICAgICAgICAgIHNpemUgKz0gcXVldWUubGVuZ3RoICsgMTtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICBpZiAoY3VycmVudE1hcmtlcikge1xuICAgICAgICBjaGFyYWN0ZXIgPSB2YWx1ZS5jaGFyQXQoaW5kZXgpO1xuXG4gICAgICAgIGlmIChjaGFyYWN0ZXIgPT09IENfVEFCKSB7XG4gICAgICAgICAgc2l6ZSArPSBUQUJfU0laRSAtIChzaXplICUgVEFCX1NJWkUpO1xuICAgICAgICAgIGluZGV4Kys7XG4gICAgICAgIH0gZWxzZSBpZiAoY2hhcmFjdGVyID09PSBDX1NQQUNFKSB7XG4gICAgICAgICAgZW5kID0gaW5kZXggKyBUQUJfU0laRTtcblxuICAgICAgICAgIHdoaWxlIChpbmRleCA8IGVuZCkge1xuICAgICAgICAgICAgaWYgKHZhbHVlLmNoYXJBdChpbmRleCkgIT09IENfU1BBQ0UpIHtcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGluZGV4Kys7XG4gICAgICAgICAgICBzaXplKys7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKGluZGV4ID09PSBlbmQgJiYgdmFsdWUuY2hhckF0KGluZGV4KSA9PT0gQ19TUEFDRSkge1xuICAgICAgICAgICAgaW5kZXggLT0gVEFCX1NJWkUgLSAxO1xuICAgICAgICAgICAgc2l6ZSAtPSBUQUJfU0laRSAtIDE7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKGNoYXJhY3RlciAhPT0gQ19ORVdMSU5FICYmIGNoYXJhY3RlciAhPT0gJycpIHtcbiAgICAgICAgICBjdXJyZW50TWFya2VyID0gbnVsbDtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cblxuICAgIGlmIChjdXJyZW50TWFya2VyKSB7XG4gICAgICBpZiAoIXBlZGFudGljICYmIG1hcmtlciAhPT0gY3VycmVudE1hcmtlcikge1xuICAgICAgICBicmVhaztcbiAgICAgIH1cblxuICAgICAgcHJlZml4ZWQgPSB0cnVlO1xuICAgIH0gZWxzZSB7XG4gICAgICBpZiAoIWNvbW1vbm1hcmsgJiYgIWluZGVudGVkICYmIHZhbHVlLmNoYXJBdChzdGFydEluZGV4KSA9PT0gQ19TUEFDRSkge1xuICAgICAgICBpbmRlbnRlZCA9IHRydWU7XG4gICAgICB9IGVsc2UgaWYgKGNvbW1vbm1hcmsgJiYgaXRlbSkge1xuICAgICAgICBpbmRlbnRlZCA9IHNpemUgPj0gaXRlbS5pbmRlbnQgfHwgc2l6ZSA+IFRBQl9TSVpFO1xuICAgICAgfVxuXG4gICAgICBwcmVmaXhlZCA9IGZhbHNlO1xuICAgICAgaW5kZXggPSBzdGFydEluZGV4O1xuICAgIH1cblxuICAgIGxpbmUgPSB2YWx1ZS5zbGljZShzdGFydEluZGV4LCBuZXh0SW5kZXgpO1xuICAgIGNvbnRlbnQgPSBzdGFydEluZGV4ID09PSBpbmRleCA/IGxpbmUgOiB2YWx1ZS5zbGljZShpbmRleCwgbmV4dEluZGV4KTtcblxuICAgIGlmIChcbiAgICAgIGN1cnJlbnRNYXJrZXIgPT09IENfQVNURVJJU0sgfHxcbiAgICAgIGN1cnJlbnRNYXJrZXIgPT09IENfVU5ERVJTQ09SRSB8fFxuICAgICAgY3VycmVudE1hcmtlciA9PT0gQ19EQVNIXG4gICAgKSB7XG4gICAgICBpZiAodG9rZ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X05FV0xJTkUpIHtcbiAgICAgIGJyZWFrO1xuICAgIH1cblxuICAgIC8qIEluIGNvbW1vbm1hcmstbW9kZSwgZm9sbG93aW5nIGluZGVudGVkIGxpbmVzXG4gICAgICogYXJlIHBhcnQgb2YgdGhlIHBhcmFncmFwaC4gKi9cbiAgICBpZiAoY29tbW9ubWFyaykge1xuICAgICAgc2l6ZSA9IDA7XG4gICAgICBwb3NpdGlvbiA9IGluZGV4ICsgMTtcblxuICAgICAgd2hpbGUgKHBvc2l0aW9uIDwgbGVuZ3RoKSB7XG4gICAgICAgIGNoYXJhY3RlciA9IHZhbHVlLmNoYXJBdChwb3NpdGlvbik7XG5cbiAgICAgICAgaWYgKGNoYXJhY3RlciA9PT0gQ19UQUIpIHtcbiAgICAgICAgICBzaXplID0gVEFCX1NJWkU7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH0gZWxzZSBpZiAoY2hhcmFjdGVyID09PSBDX1NQQUNFKSB7XG4gICAgICAgICAgc2l6ZSsrO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG5cbiAgICAgICAgcG9zaXRpb24rKztcbiAgICAgIH1cblxuICAgICAgaWYgKHNpemUgPj0gVEFCX1NJWkUpIHtcbiAgICAgICAgaW5kZXggPSB2YWx1ZS5pbmRleE9mKENfTkVXTElORSwgaW5kZXggKyAxKTtcbiAgICAgICAgY29udGludWU7XG4gICAgICB9XG4gICAgfVxuXG4gICAgc3VidmFsdWUgPSB2YWx1ZS5zbGljZShpbmRleCArIDEpO1xuXG4gICAgLyogQ2hlY2sgaWYgdGhlIGZvbGxvd2luZyBjb2RlIGNvbnRhaW5zIGEgcG9zc2libGVcbiAgICAgKiBibG9jay4gKi9cbiAgICBpZiAoaW50ZXJydXB0KGludGVycnVwdG9ycywgdG9rZW5pemVycywgc2VsZiwgW2VhdCwgc3VidmFsdWUsIHRydWVdKSkge1xuICAgICAgYnJlYWs7XG4gICAgfVxuXG4gICAg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AgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBzdWJ2YWx1ZSArPSBxdWV1ZTtcbiAgICAgICAgICAgICAgICBxdWV1ZSA9ICcnO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIG5vdyA9IGVhdC5ub3coKTtcblxuICAgICAgICAgICAgZWF0KHN1YnZhbHVlKSh7XG4gICAgICAgICAgICAgIHR5cGU6ICd0YWJsZUNlbGwnLFxuICAgICAgICAgICAgICBjaGlsZHJlbjogc2VsZi50b2tlbml6ZUlubGluZShjZWxsLCBub3cpXG4gICAgICAgICAgICB9LCByb3cpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGVhdChxdWV1ZSArIGNoYXJhY3Rlcik7XG5cbiAgICAgICAgICBxdWV1ZSA9ICcnO1xuICAgICAgICAgIGNlbGwgPSAnJztcbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgaWYgKHF1ZXVlKSB7XG4gICAgICAgICAgY2VsbCArPSBxdWV1ZTtcbiAgICAgICAgICBxdWV1ZSA9ICcnO1xuICAgICAgICB9XG5cbiAgICAgICAgY2VsbCArPSBjaGFyYWN0ZXI7XG5cbiAgICAgICAgaWYgKGNoYXJhY3RlciA9PT0gQ19CQUNLU0xBU0ggJiYgaW5kZXggIT09IGxlbmd0aCAtIDIpIHtcbiAgICAgICAgICBjZWxsICs9IGxpbmUuY2hhckF0KGluZGV4ICsgMSk7XG4gICAgICAgICAgaW5kZXgrKztcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChjaGFyYWN0ZXIgPT09IENfVElDSykge1xuICAgICAgICAgIGNvdW50ID0gMTtcblxuICAgICAgICAgIHdoaWxlIChsaW5lLmNoYXJBdChpbmRleCArIDEpID09PSBjaGFyYWN0ZXIpIHtcbiAgICAgICAgICAgIGNlbGwgKz0gY2hhcmFjdGVyO1xuICAgICAgICAgICAgaW5kZXgrKztcbiAgICAgICAgICAgIGNvdW50Kys7XG4gIC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xuICAgICAgICAgIH1cblxuICAgICAgICAgIGluZGVudCA9IGNvbWJpbmVkLmNvbmNhdChpbmRlbnQpO1xuICAgICAgICB9XG5cbiAgICAgICAgbm9kZS5wb3NpdGlvbi5pbmRlbnQgPSBpbmRlbnQgfHwgW107XG5cbiAgICAgICAgcmV0dXJuIG5vZGU7XG4gICAgICB9XG4gICAgfVxuXG4gICAgLyogQWRkIGBub2RlYCB0byBgcGFyZW50YHMgY2hpbGRyZW4gb3IgdG8gYHRva2Vuc2AuXG4gICAgICogUGVyZm9ybXMgbWVyZ2VzIHdoZXJlIHBvc3NpYmxlLiAqL1xuICAgIGZ1bmN0aW9uIGFkZChub2RlLCBwYXJlbnQpIHtcbiAgICAgIHZhciBjaGlsZHJlbiA9IHBhcmVudCA/IHBhcmVudC5jaGlsZHJlbiA6IHRva2VucztcbiAgICAgIHZhciBwcmV2ID0gY2hpbGRyZW5bY2hpbGRyZW4ubGVuZ3RoIC0gMV07XG5cbiAgICAgIGlmIChcbiAgICAgICAgcHJldiAmJlxuICAgICAgICBub2RlLnR5cGUgPT09IHByZXYudHlwZSAmJlxuICAgICAgICBub2RlLnR5cGUgaW4gTUVSR0VBQkxFX05PREVTICYmXG4gICAgICAgIG1lcmdlYWJsZShwcmV2KSAmJlxuICAgICAgICBtZXJnZWFibGUobm9kZSlcbiAgICAgICkge1xuICAgICAgICBub2RlID0gTUVSR0VBQkxFX05PREVTW25vZGUudHlwZV0uY2FsbChzZWxmLCBwcmV2LCBub2RlKTtcbiAgICAgIH1cblxuICAgICAgaWYgKG5vZGUgIT09IHByZXYpIHtcbiAgICAgICAgY2hpbGRyZW4ucHVzaChub2RlKTtcbiAgICAgIH1cblxuICAgICAgaWYgKHNlbGYuYXRTdGFydCAmJiB0b2tlbnMubGVuZ3RoICE9PSAwKSB7XG4gICAgICAgIHNlbGYuZXhpdFN0YXJ0KCk7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBub2RlO1xuICAgIH1cblxuICAgIC8qIFJlb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uICAgICAgICAgICAgICBOQU1FRF9FTVBUWTtcblxuICAgICAgICAgICAgaWYgKCFzZXR0aW5ncy5hdHRyaWJ1dGUpIHtcbiAgICAgICAgICAgICAgd2FybmluZyhyZWFzb24sIGRpZmYpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgZm9sbG93aW5nID0gYXQoZW5kKTtcblxuICAgICAgICAgICAgICBpZiAoZm9sbG93aW5nID09PSBFUVVBTCkge1xuICAgICAgICAgICAgICAgIHdhcm5pbmcocmVhc29uLCBkaWZmKTtcbiAgICAgICAgICAgICAgICBlbnRpdHkgPSBudWxsO1xuICAgICAgICAgICAgICB9IGVsc2UgaWYgKGFscGhhbnVtZXJpY2FsKGZvbGxvd2luZykpIHtcbiAgICAgICAgICAgICAgICBlbnRpdHkgPSBudWxsO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHdhcm5pbmcocmVhc29uLCBkaWZmKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJlZmVyZW5jZSA9IGVudGl0eTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGlmICghdGVybWluYXRlZCkge1xuICAgICAgICAgIC8qIEFsbCBub24tdGVybWluYXRlZCBudW1lcmljIGVudGl0aWVzIGFyZVxuICAgICAgICAgICAqIG5vdCByZW5kZXJlZCwgYW5kIHRyaWdnZXIgYSB3YXJuaW5nLiAqL1xuICAgICAgICAgIHdhcm5pbmcoTlVNRVJJQ19OT1RfVEVSTUlOQVRFRCwgZGlmZik7XG4gICAgICAgIH1cblxuICAgICAgICAvKiBXaGVuIHRlcm1pbmF0ZWQgYW5kIG51bWJlciwgcGFyc2UgYXNcbiAgICAgICAgICogZWl0aGVyIGhleGFkZWNpbWFsIG9yIGRlY2ltYWwuICovXG4gICAgICAgIHJlZmVyZW5jZSA9IHBhcnNlSW50KGNoYXJhY3Rlcn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ciB4dGVuZCA9IHJlcXVpcmUoJ3h0ZW5kJyk7XG52YXIgUGFyc2VyID0gcmVxdWlyZSgnLi9saWIvcGFyc2VyLmpzJyk7XG5cbm1vZHVsZS5leHBvcnRzID0gcGFyc2U7XG5wYXJzZS5QYXJzZXIgPSBQYXJzZXI7XG5cbmZ1bmN0aW9uIHBhcnNlKG9wdGlvbnMpIHtcbiAgdmFyIExvY2FsID0gdW5oZXJpdChQYXJzZXIpO1xuICBMb2NhbC5wcm90b3R5cGUub3B0aW9ucyA9IHh0ZW5kKExvY2FsLnByb3RvdHlwZS5vcHRpb25zLCB0aGlzLmRhdGEoJ3NldHRpbmdzJyksIG9wdGlvbnMpO1xuICB0aGlzLlBhcnNlciA9IExvY2FsO1xufVxuIl19 | |
require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | |
'use strict'; | |
module.exports = require('./lib/index.js'); | |
},{"./lib/index.js":28}],2:[function(require,module,exports){ | |
'use strict'; | |
module.exports = all; | |
var trim = require('trim'); | |
var one = require('./one'); | |
/* Transform the children of `parent`. */ | |
function all(h, parent) { | |
var nodes = parent.children || []; | |
var length = nodes.length; | |
var values = []; | |
var index = -1; | |
var result; | |
var head; | |
while (++index < length) { | |
result = one(h, nodes[index], parent); | |
if (result) { | |
if (index && nodes[index - 1].type === 'break') { | |
if (result.value) { | |
result.value = trim.left(result.value); | |
} | |
head = result.children && result.children[0]; | |
if (head && head.value) { | |
head.value = trim.left(head.value); | |
} | |
} | |
values = values.concat(result); | |
} | |
} | |
return values; | |
} | |
},{"./one":29,"trim":37}],3:[function(require,module,exports){ | |
'use strict'; | |
module.exports = failsafe; | |
var u = require('unist-builder'); | |
var all = require('./all'); | |
/* Return the content of a reference without definition | |
* as markdown. */ | |
function failsafe(h, node, definition) { | |
var subtype = node.referenceType; | |
if (subtype !== 'collapsed' && subtype !== 'full' && !definition) { | |
if (node.type === 'imageReference') { | |
return u('text', '![' + node.alt + ']'); | |
} | |
return [u('text', '[')].concat(all(h, node), u('text', ']')); | |
} | |
} | |
},{"./all":2,"unist-builder":38}],4:[function(require,module,exports){ | |
'use strict'; | |
module.exports = generateFootnotes; | |
var thematicBreak = require('./handlers/thematic-break'); | |
var list = require('./handlers/list'); | |
var wrap = require('./wrap'); | |
/* Transform all footnote definitions, if any. */ | |
function generateFootnotes(h) { | |
var footnotes = h.footnotes; | |
var length = footnotes.length; | |
var index = -1; | |
var listItems = []; | |
var def; | |
if (!length) { | |
return null; | |
} | |
while (++index < length) { | |
def = footnotes[index]; | |
listItems[index] = { | |
type: 'listItem', | |
data: {hProperties: {id: 'fn-' + def.identifier}}, | |
children: def.children.concat({ | |
type: 'link', | |
url: '#fnref-' + def.identifier, | |
data: {hProperties: {className: ['footnote-backref']}}, | |
children: [{ | |
type: 'text', | |
value: '↩' | |
}] | |
}), | |
position: def.position | |
}; | |
} | |
return h(null, 'div', { | |
className: ['footnotes'] | |
}, wrap([ | |
thematicBreak(h), | |
list(h, { | |
type: 'list', | |
ordered: true, | |
children: listItems | |
}) | |
], true)); | |
} | |
},{"./handlers/list":21,"./handlers/thematic-break":27,"./wrap":30}],5:[function(require,module,exports){ | |
'use strict'; | |
module.exports = blockquote; | |
var wrap = require('../wrap'); | |
var all = require('../all'); | |
/* Transform a block quote. */ | |
function blockquote(h, node) { | |
return h(node, 'blockquote', wrap(all(h, node), true)); | |
} | |
},{"../all":2,"../wrap":30}],6:[function(require,module,exports){ | |
'use strict'; | |
module.exports = hardBreak; | |
var u = require('unist-builder'); | |
/* Transform an inline break. */ | |
function hardBreak(h, node) { | |
return [h(node, 'br'), u('text', '\n')]; | |
} | |
},{"unist-builder":38}],7:[function(require,module,exports){ | |
'use strict'; | |
module.exports = code; | |
var detab = require('detab'); | |
var u = require('unist-builder'); | |
/* Transform a code block. */ | |
function code(h, node) { | |
var value = node.value ? detab(node.value + '\n') : ''; | |
var lang = node.lang && node.lang.match(/^[^ \t]+(?=[ \t]|$)/); | |
var props = {}; | |
if (lang) { | |
props.className = ['language-' + lang]; | |
} | |
return h(node.position, 'pre', [ | |
h(node, 'code', props, [u('text', value)]) | |
]); | |
} | |
},{"detab":32,"unist-builder":38}],8:[function(require,module,exports){ | |
'use strict'; | |
module.exports = strikethrough; | |
var all = require('../all'); | |
/* Transform deletions. */ | |
function strikethrough(h, node) { | |
return h(node, 'del', all(h, node)); | |
} | |
},{"../all":2}],9:[function(require,module,exports){ | |
'use strict'; | |
module.exports = emphasis; | |
var all = require('../all'); | |
/* Transform emphasis. */ | |
function emphasis(h, node) { | |
return h(node, 'em', all(h, node)); | |
} | |
},{"../all":2}],10:[function(require,module,exports){ | |
'use strict'; | |
module.exports = footnoteReference; | |
var u = require('unist-builder'); | |
/* Transform a reference to a footnote. */ | |
function footnoteReference(h, node) { | |
var identifier = node.identifier; | |
return h(node.position, 'sup', {id: 'fnref-' + identifier}, [ | |
h(node, 'a', { | |
href: '#fn-' + identifier, | |
className: ['footnote-ref'] | |
}, [u('text', identifier)]) | |
]); | |
} | |
},{"unist-builder":38}],11:[function(require,module,exports){ | |
'use strict'; | |
module.exports = footnote; | |
var footnoteReference = require('./footnote-reference'); | |
/* Transform an inline footnote. */ | |
function footnote(h, node) { | |
var identifiers = []; | |
var identifier = 1; | |
var footnotes = h.footnotes; | |
var length = footnotes.length; | |
var index = -1; | |
while (++index < length) { | |
identifiers[index] = footnotes[index].identifier; | |
} | |
while (identifiers.indexOf(String(identifier)) !== -1) { | |
identifier++; | |
} | |
identifier = String(identifier); | |
footnotes.push({ | |
type: 'footnoteDefinition', | |
identifier: identifier, | |
children: node.children, | |
position: node.position | |
}); | |
return footnoteReference(h, { | |
type: 'footnoteReference', | |
identifier: identifier, | |
position: node.position | |
}); | |
} | |
},{"./footnote-reference":10}],12:[function(require,module,exports){ | |
'use strict'; | |
module.exports = heading; | |
var all = require('../all'); | |
/* Transform a heading. */ | |
function heading(h, node) { | |
return h(node, 'h' + node.depth, all(h, node)); | |
} | |
},{"../all":2}],13:[function(require,module,exports){ | |
'use strict'; | |
module.exports = html; | |
var u = require('unist-builder'); | |
/* Return either a `raw` node, in dangerous mode, or | |
* nothing. */ | |
function html(h, node) { | |
return h.dangerous ? h.augment(node, u('raw', node.value)) : null; | |
} | |
},{"unist-builder":38}],14:[function(require,module,exports){ | |
'use strict'; | |
module.exports = imageReference; | |
var normalize = require('normalize-uri'); | |
var failsafe = require('../failsafe'); | |
/* Transform a reference to an image. */ | |
function imageReference(h, node) { | |
var def = h.definition(node.identifier); | |
var props = {src: normalize((def && def.url) || ''), alt: node.alt}; | |
if (def && def.title !== null && def.title !== undefined) { | |
props.title = def.title; | |
} | |
return failsafe(h, node, def) || h(node, 'img', props); | |
} | |
},{"../failsafe":3,"normalize-uri":35}],15:[function(require,module,exports){ | |
'use strict'; | |
var normalize = require('normalize-uri'); | |
module.exports = image; | |
/* Transform an image. */ | |
function image(h, node) { | |
var props = {src: normalize(node.url), alt: node.alt}; | |
if (node.title !== null && node.title !== undefined) { | |
props.title = node.title; | |
} | |
return h(node, 'img', props); | |
} | |
},{"normalize-uri":35}],16:[function(require,module,exports){ | |
'use strict'; | |
module.exports = { | |
blockquote: require('./blockquote'), | |
break: require('./break'), | |
code: require('./code'), | |
delete: require('./delete'), | |
emphasis: require('./emphasis'), | |
footnoteReference: require('./footnote-reference'), | |
footnote: require('./footnote'), | |
heading: require('./heading'), | |
html: require('./html'), | |
imageReference: require('./image-reference'), | |
image: require('./image'), | |
inlineCode: require('./inline-code'), | |
linkReference: require('./link-reference'), | |
link: require('./link'), | |
listItem: require('./list-item'), | |
list: require('./list'), | |
paragraph: require('./paragraph'), | |
root: require('./root'), | |
strong: require('./strong'), | |
table: require('./table'), | |
text: require('./text'), | |
thematicBreak: require('./thematic-break'), | |
yaml: ignore, | |
definition: ignore, | |
footnoteDefinition: ignore | |
}; | |
/* Return nothing for nodes which are ignored. */ | |
function ignore() { | |
return null; | |
} | |
},{"./blockquote":5,"./break":6,"./code":7,"./delete":8,"./emphasis":9,"./footnote":11,"./footnote-reference":10,"./heading":12,"./html":13,"./image":15,"./image-reference":14,"./inline-code":17,"./link":19,"./link-reference":18,"./list":21,"./list-item":20,"./paragraph":22,"./root":23,"./strong":24,"./table":25,"./text":26,"./thematic-break":27}],17:[function(require,module,exports){ | |
'use strict'; | |
module.exports = inlineCode; | |
var collapse = require('collapse-white-space'); | |
var u = require('unist-builder'); | |
/* Transform inline code. */ | |
function inlineCode(h, node) { | |
return h(node, 'code', [u('text', collapse(node.value))]); | |
} | |
},{"collapse-white-space":31,"unist-builder":38}],18:[function(require,module,exports){ | |
'use strict'; | |
module.exports = linkReference; | |
var normalize = require('normalize-uri'); | |
var failsafe = require('../failsafe'); | |
var all = require('../all'); | |
/* Transform a reference to a link. */ | |
function linkReference(h, node) { | |
var def = h.definition(node.identifier); | |
var props = {href: normalize((def && def.url) || '')}; | |
if (def && def.title !== null && def.title !== undefined) { | |
props.title = def.title; | |
} | |
return failsafe(h, node, def) || h(node, 'a', props, all(h, node)); | |
} | |
},{"../all":2,"../failsafe":3,"normalize-uri":35}],19:[function(require,module,exports){ | |
'use strict'; | |
var normalize = require('normalize-uri'); | |
var all = require('../all'); | |
module.exports = link; | |
/* Transform a link. */ | |
function link(h, node) { | |
var props = {href: normalize(node.url)}; | |
if (node.title !== null && node.title !== undefined) { | |
props.title = node.title; | |
} | |
return h(node, 'a', props, all(h, node)); | |
} | |
},{"../all":2,"normalize-uri":35}],20:[function(require,module,exports){ | |
'use strict'; | |
module.exports = listItem; | |
var u = require('unist-builder'); | |
var wrap = require('../wrap'); | |
var all = require('../all'); | |
/* Transform a list-item. */ | |
function listItem(h, node, parent) { | |
var children = node.children; | |
var head = children[0]; | |
var props = {}; | |
var single = false; | |
var result; | |
var container; | |
if ((!parent || !parent.loose) && children.length === 1 && head.type === 'paragraph') { | |
single = true; | |
} | |
result = all(h, single ? head : node); | |
if (typeof node.checked === 'boolean') { | |
if (!single && (!head || head.type !== 'paragraph')) { | |
result.unshift(h(null, 'p', [])); | |
} | |
container = single ? result : result[0].children; | |
if (container.length !== 0) { | |
container.unshift(u('text', ' ')); | |
} | |
container.unshift(h(null, 'input', { | |
type: 'checkbox', | |
checked: node.checked, | |
disabled: true | |
})); | |
/* According to github-markdown-css, this class hides bullet. */ | |
props.className = ['task-list-item']; | |
} | |
if (!single && result.length !== 0) { | |
result = wrap(result, true); | |
} | |
return h(node, 'li', props, result); | |
} | |
},{"../all":2,"../wrap":30,"unist-builder":38}],21:[function(require,module,exports){ | |
'use strict'; | |
module.exports = list; | |
var wrap = require('../wrap'); | |
var all = require('../all'); | |
/* Transform a list. */ | |
function list(h, node) { | |
var props = {}; | |
var name = node.ordered ? 'ol' : 'ul'; | |
if (typeof node.start === 'number' && node.start !== 1) { | |
props.start = node.start; | |
} | |
return h(node, name, props, wrap(all(h, node), true)); | |
} | |
},{"../all":2,"../wrap":30}],22:[function(require,module,exports){ | |
'use strict'; | |
module.exports = paragraph; | |
var all = require('../all'); | |
/* Transform a paragraph. */ | |
function paragraph(h, node) { | |
return h(node, 'p', all(h, node)); | |
} | |
},{"../all":2}],23:[function(require,module,exports){ | |
'use strict'; | |
module.exports = root; | |
var u = require('unist-builder'); | |
var wrap = require('../wrap'); | |
var all = require('../all'); | |
/* Transform a `root`. */ | |
function root(h, node) { | |
return h.augment(node, u('root', wrap(all(h, node)))); | |
} | |
},{"../all":2,"../wrap":30,"unist-builder":38}],24:[function(require,module,exports){ | |
'use strict'; | |
module.exports = strong; | |
var all = require('../all'); | |
/* Transform importance. */ | |
function strong(h, node) { | |
return h(node, 'strong', all(h, node)); | |
} | |
},{"../all":2}],25:[function(require,module,exports){ | |
'use strict'; | |
module.exports = table; | |
var position = require('unist-util-position'); | |
var wrap = require('../wrap'); | |
var all = require('../all'); | |
/* Transform a table. */ | |
function table(h, node) { | |
var rows = node.children; | |
var index = rows.length; | |
var align = node.align; | |
var alignLength = align.length; | |
var result = []; | |
var pos; | |
var row; | |
var out; | |
var name; | |
var cell; | |
while (index--) { | |
row = rows[index].children; | |
name = index === 0 ? 'th' : 'td'; | |
pos = alignLength; | |
out = []; | |
while (pos--) { | |
cell = row[pos]; | |
out[pos] = h(cell, name, { | |
align: align[pos] | |
}, cell ? wrap(all(h, cell)) : []); | |
} | |
result[index] = h(rows[index], 'tr', wrap(out, true)); | |
} | |
return h(node, 'table', wrap([ | |
h(result[0].position, 'thead', wrap([result[0]], true)), | |
h({ | |
start: position.start(result[1]), | |
end: position.end(result[result.length - 1]) | |
}, 'tbody', wrap(result.slice(1), true)) | |
], true)); | |
} | |
},{"../all":2,"../wrap":30,"unist-util-position":41}],26:[function(require,module,exports){ | |
'use strict'; | |
module.exports = text; | |
var u = require('unist-builder'); | |
var trimLines = require('trim-lines'); | |
/* Transform text. */ | |
function text(h, node) { | |
return h.augment(node, u('text', trimLines(node.value))); | |
} | |
},{"trim-lines":36,"unist-builder":38}],27:[function(require,module,exports){ | |
'use strict'; | |
module.exports = thematicBreak; | |
/* Transform a thematic break / horizontal rule. */ | |
function thematicBreak(h, node) { | |
return h(node, 'hr'); | |
} | |
},{}],28:[function(require,module,exports){ | |
'use strict'; | |
module.exports = toHAST; | |
var xtend = require('xtend'); | |
var u = require('unist-builder'); | |
var visit = require('unist-util-visit'); | |
var position = require('unist-util-position'); | |
var generated = require('unist-util-generated'); | |
var definitions = require('mdast-util-definitions'); | |
var one = require('./one'); | |
var footer = require('./footer'); | |
var handlers = require('./handlers'); | |
/* Factory to transform. */ | |
function factory(tree, options) { | |
var settings = options || {}; | |
var dangerous = settings.allowDangerousHTML; | |
h.dangerous = dangerous; | |
h.definition = definitions(tree, settings); | |
h.footnotes = []; | |
h.augment = augment; | |
h.handlers = xtend(handlers, (settings.handlers || {})); | |
visit(tree, 'footnoteDefinition', visitor); | |
return h; | |
/* Finalise the created `right`, a HAST node, from | |
* `left`, an MDAST node. */ | |
function augment(left, right) { | |
var data; | |
var ctx; | |
/* Handle `data.hName`, `data.hProperties, `hChildren`. */ | |
if (left && 'data' in left) { | |
data = left.data; | |
if (right.type === 'element' && data.hName) { | |
right.tagName = data.hName; | |
} | |
if (right.type === 'element' && data.hProperties) { | |
right.properties = xtend(right.properties, data.hProperties); | |
} | |
if (right.children && data.hChildren) { | |
right.children = data.hChildren; | |
} | |
} | |
ctx = left && left.position ? left : {position: left}; | |
if (!generated(ctx)) { | |
right.position = { | |
start: position.start(ctx), | |
end: position.end(ctx) | |
}; | |
} | |
return right; | |
} | |
/* Create an element for a `node`. */ | |
function h(node, tagName, props, children) { | |
if ( | |
(children === undefined || children === null) && | |
typeof props === 'object' && | |
'length' in props | |
) { | |
children = props; | |
props = {}; | |
} | |
return augment(node, { | |
type: 'element', | |
tagName: tagName, | |
properties: props || {}, | |
children: children || [] | |
}); | |
} | |
function visitor(definition) { | |
h.footnotes.push(definition); | |
} | |
} | |
/* Transform `tree`, which is an MDAST node, to a HAST node. */ | |
function toHAST(tree, options) { | |
var h = factory(tree, options); | |
var node = one(h, tree); | |
var footnotes = footer(h); | |
if (node && node.children && footnotes) { | |
node.children = node.children.concat(u('text', '\n'), footnotes); | |
} | |
return node; | |
} | |
},{"./footer":4,"./handlers":16,"./one":29,"mdast-util-definitions":34,"unist-builder":38,"unist-util-generated":40,"unist-util-position":41,"unist-util-visit":42,"xtend":43}],29:[function(require,module,exports){ | |
'use strict'; | |
module.exports = one; | |
var u = require('unist-builder'); | |
var all = require('./all'); | |
var own = {}.hasOwnProperty; | |
/* Transform an unknown node. */ | |
function unknown(h, node) { | |
if (text(node)) { | |
return h.augment(node, u('text', node.value)); | |
} | |
return h(node, 'div', all(h, node)); | |
} | |
/* Visit a node. */ | |
function one(h, node, parent) { | |
var type = node && node.type; | |
var fn = own.call(h.handlers, type) ? h.handlers[type] : null; | |
/* Fail on non-nodes. */ | |
if (!type) { | |
throw new Error('Expected node, got `' + node + '`'); | |
} | |
return (typeof fn === 'function' ? fn : unknown)(h, node, parent); | |
} | |
/* Check if the node should be renderered a text node. */ | |
function text(node) { | |
var data = node.data || {}; | |
if (own.call(data, 'hName') || own.call(data, 'hProperties') || own.call(data, 'hChildren')) { | |
return false; | |
} | |
return 'value' in node; | |
} | |
},{"./all":2,"unist-builder":38}],30:[function(require,module,exports){ | |
'use strict'; | |
module.exports = wrap; | |
var u = require('unist-builder'); | |
/* Wrap `nodes` with newlines between each entry. | |
* Optionally adds newlines at the start and end. */ | |
function wrap(nodes, loose) { | |
var result = []; | |
var index = -1; | |
var length = nodes.length; | |
if (loose) { | |
result.push(u('text', '\n')); | |
} | |
while (++index < length) { | |
if (index) { | |
result.push(u('text', '\n')); | |
} | |
result.push(nodes[index]); | |
} | |
if (loose && nodes.length !== 0) { | |
result.push(u('text', '\n')); | |
} | |
return result; | |
} | |
},{"unist-builder":38}],31:[function(require,module,exports){ | |
'use strict'; | |
module.exports = collapse; | |
/* collapse(' \t\nbar \nbaz\t'); // ' bar baz ' */ | |
function collapse(value) { | |
return String(value).replace(/\s+/g, ' '); | |
} | |
},{}],32:[function(require,module,exports){ | |
'use strict'; | |
module.exports = detab; | |
var repeat = require('repeat-string'); | |
var TAB = 0x09; | |
var LF = 0x0A; | |
var CR = 0x0D; | |
/* Replace tabs with spaces, being smart about which | |
* column the tab is at and which size should be used. */ | |
function detab(value, size) { | |
var string = typeof value === 'string'; | |
var length = string && value.length; | |
var start = 0; | |
var index = -1; | |
var column = -1; | |
var tabSize = size || 4; | |
var results = []; | |
var code; | |
var add; | |
if (!string) { | |
throw new Error('detab expected string'); | |
} | |
while (++index < length) { | |
code = value.charCodeAt(index); | |
if (code === TAB) { | |
add = tabSize - ((column + 1) % tabSize); | |
column += add; | |
results.push(value.slice(start, index) + repeat(' ', add)); | |
start = index + 1; | |
} else if (code === LF || code === CR) { | |
column = -1; | |
} else { | |
column++; | |
} | |
} | |
results.push(value.slice(start)); | |
return results.join(''); | |
} | |
},{"repeat-string":33}],33:[function(require,module,exports){ | |
/*! | |
* repeat-string <https://github.com/jonschlinkert/repeat-string> | |
* | |
* Copyright (c) 2014-2015, Jon Schlinkert. | |
* Licensed under the MIT License. | |
*/ | |
'use strict'; | |
/** | |
* Results cache | |
*/ | |
var res = ''; | |
var cache; | |
/** | |
* Expose `repeat` | |
*/ | |
module.exports = repeat; | |
/** | |
* Repeat the given `string` the specified `number` | |
* of times. | |
* | |
* **Example:** | |
* | |
* ```js | |
* var repeat = require('repeat-string'); | |
* repeat('A', 5); | |
* //=> AAAAA | |
* ``` | |
* | |
* @param {String} `string` The string to repeat | |
* @param {Number} `number` The number of times to repeat the string | |
* @return {String} Repeated string | |
* @api public | |
*/ | |
function repeat(str, num) { | |
if (typeof str !== 'string') { | |
throw new TypeError('expected a string'); | |
} | |
// cover common, quick use cases | |
if (num === 1) return str; | |
if (num === 2) return str + str; | |
var max = str.length * num; | |
if (cache !== str || typeof cache === 'undefined') { | |
cache = str; | |
res = ''; | |
} else if (res.length >= max) { | |
return res.substr(0, max); | |
} | |
while (max > res.length && num > 1) { | |
if (num & 1) { | |
res += str; | |
} | |
num >>= 1; | |
str += str; | |
} | |
res += str; | |
res = res.substr(0, max); | |
return res; | |
} | |
},{}],34:[function(require,module,exports){ | |
'use strict'; | |
var visit = require('unist-util-visit'); | |
module.exports = getDefinitionFactory; | |
var own = {}.hasOwnProperty; | |
/* Get a definition in `node` by `identifier`. */ | |
function getDefinitionFactory(node, options) { | |
return getterFactory(gather(node, options)); | |
} | |
/* Gather all definitions in `node` */ | |
function gather(node, options) { | |
var cache = {}; | |
if (!node || !node.type) { | |
throw new Error('mdast-util-definitions expected node'); | |
} | |
visit(node, 'definition', options && options.commonmark ? commonmark : normal); | |
return cache; | |
function commonmark(definition) { | |
var id = normalise(definition.identifier); | |
if (!own.call(cache, id)) { | |
cache[id] = definition; | |
} | |
} | |
function normal(definition) { | |
cache[normalise(definition.identifier)] = definition; | |
} | |
} | |
/* Factory to get a node from the given definition-cache. */ | |
function getterFactory(cache) { | |
return getter; | |
/* Get a node from the bound definition-cache. */ | |
function getter(identifier) { | |
var id = identifier && normalise(identifier); | |
return id && own.call(cache, id) ? cache[id] : null; | |
} | |
} | |
function normalise(identifier) { | |
return identifier.toUpperCase(); | |
} | |
},{"unist-util-visit":42}],35:[function(require,module,exports){ | |
'use strict'; | |
module.exports = returner; | |
try { | |
normalize(''); | |
module.exports = normalize; | |
} catch (err) {} | |
/* Normalize `uri`. */ | |
function normalize(uri) { | |
return encodeURI(decodeURI(uri)); | |
} | |
/* istanbul ignore next - Fallback, return input. */ | |
function returner(uri) { | |
return uri; | |
} | |
},{}],36:[function(require,module,exports){ | |
'use strict'; | |
module.exports = trimLines; | |
var ws = /[ \t]*\n+[ \t]*/g; | |
var newline = '\n'; | |
function trimLines(value) { | |
return String(value).replace(ws, newline); | |
} | |
},{}],37:[function(require,module,exports){ | |
exports = module.exports = trim; | |
function trim(str){ | |
return str.replace(/^\s*|\s*$/g, ''); | |
} | |
exports.left = function(str){ | |
return str.replace(/^\s*/, ''); | |
}; | |
exports.right = function(str){ | |
return str.replace(/\s*$/, ''); | |
}; | |
},{}],38:[function(require,module,exports){ | |
'use strict'; | |
var assign = require('object-assign'); | |
module.exports = function u (type, props, value) { | |
if (value == null && (typeof props != 'object' || Array.isArray(props))) { | |
value = props; | |
props = {}; | |
} | |
return assign({}, props, { type: String(type) }, | |
value != null && (Array.isArray(value) | |
? { children: value } | |
: { value: String(value) })); | |
}; | |
},{"object-assign":39}],39:[function(require,module,exports){ | |
/* | |
object-assign | |
(c) Sindre Sorhus | |
@license MIT | |
*/ | |
'use strict'; | |
/* eslint-disable no-unused-vars */ | |
var getOwnPropertySymbols = Object.getOwnPropertySymbols; | |
var hasOwnProperty = Object.prototype.hasOwnProperty; | |
var propIsEnumerable = Object.prototype.propertyIsEnumerable; | |
function toObject(val) { | |
if (val === null || val === undefined) { | |
throw new TypeError('Object.assign cannot be called with null or undefined'); | |
} | |
return Object(val); | |
} | |
function shouldUseNative() { | |
try { | |
if (!Object.assign) { | |
return false; | |
} | |
// Detect buggy property enumeration order in older V8 versions. | |
// https://bugs.chromium.org/p/v8/issues/detail?id=4118 | |
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers | |
test1[5] = 'de'; | |
if (Object.getOwnPropertyNames(test1)[0] === '5') { | |
return false; | |
} | |
// https://bugs.chromium.org/p/v8/issues/detail?id=3056 | |
var test2 = {}; | |
for (var i = 0; i < 10; i++) { | |
test2['_' + String.fromCharCode(i)] = i; | |
} | |
var order2 = Object.getOwnPropertyNames(test2).map(function (n) { | |
return test2[n]; | |
}); | |
if (order2.join('') !== '0123456789') { | |
return false; | |
} | |
// https://bugs.chromium.org/p/v8/issues/detail?id=3056 | |
var test3 = {}; | |
'abcdefghijklmnopqrst'.split('').forEach(function (letter) { | |
test3[letter] = letter; | |
}); | |
if (Object.keys(Object.assign({}, test3)).join('') !== | |
'abcdefghijklmnopqrst') { | |
return false; | |
} | |
return true; | |
} catch (err) { | |
// We don't expect any of the above to throw, but better to be safe. | |
return false; | |
} | |
} | |
module.exports = shouldUseNative() ? Object.assign : function (target, source) { | |
var from; | |
var to = toObject(target); | |
var symbols; | |
for (var s = 1; s < arguments.length; s++) { | |
from = Object(arguments[s]); | |
for (var key in from) { | |
if (hasOwnProperty.call(from, key)) { | |
to[key] = from[key]; | |
} | |
} | |
if (getOwnPropertySymbols) { | |
symbols = getOwnPropertySymbols(from); | |
for (var i = 0; i < symbols.length; i++) { | |
if (propIsEnumerable.call(from, symbols[i])) { | |
to[symbols[i]] = from[symbols[i]]; | |
} | |
} | |
} | |
} | |
return to; | |
}; | |
},{}],40:[function(require,module,exports){ | |
'use strict'; | |
/* Expose. */ | |
module.exports = generated; | |
/* Detect if a node was available in the original document. */ | |
function generated(node) { | |
var position = optional(optional(node).position); | |
var start = optional(position.start); | |
var end = optional(position.end); | |
return !start.line || !start.column || !end.line || !end.column; | |
} | |
/* Return `value` if it’s an object, an empty object | |
* otherwise. */ | |
function optional(value) { | |
return value && typeof value === 'object' ? value : {}; | |
} | |
},{}],41:[function(require,module,exports){ | |
'use strict'; | |
/* Expose. */ | |
var position = exports; | |
position.start = positionFactory('start'); | |
position.end = positionFactory('end'); | |
/* Factory to get a position at `type`. */ | |
function positionFactory(type) { | |
return pos; | |
/* Get a position in `node` at a bound `type`. */ | |
function pos(node) { | |
var pos = (node && node.position && node.position[type]) || {}; | |
return { | |
line: pos.line || null, | |
column: pos.column || null, | |
offset: isNaN(pos.offset) ? null : pos.offset | |
}; | |
} | |
} | |
},{}],42:[function(require,module,exports){ | |
'use strict'; | |
/* Expose. */ | |
module.exports = visit; | |
/* Visit. */ | |
function visit(tree, type, visitor, reverse) { | |
if (typeof type === 'function') { | |
reverse = visitor; | |
visitor = type; | |
type = null; | |
} | |
one(tree); | |
/* Visit a single node. */ | |
function one(node, index, parent) { | |
var result; | |
index = index || (parent ? 0 : null); | |
if (!type || node.type === type) { | |
result = visitor(node, index, parent || null); | |
} | |
if (node.children && result !== false) { | |
return all(node.children, node); | |
} | |
return result; | |
} | |
/* Visit children in `parent`. */ | |
function all(children, parent) { | |
var step = reverse ? -1 : 1; | |
var max = children.length; | |
var min = -1; | |
var index = (reverse ? max : min) + step; | |
var child; | |
while (index > min && index < max) { | |
child = children[index]; | |
if (child && one(child, index, parent) === false) { | |
return false; | |
} | |
index += step; | |
} | |
return true; | |
} | |
} | |
},{}],43:[function(require,module,exports){ | |
module.exports = extend | |
var hasOwnProperty = Object.prototype.hasOwnProperty; | |
function extend() { | |
var target = {} | |
for (var i = 0; i < arguments.length; i++) { | |
var source = arguments[i] | |
for (var key in source) { | |
if (hasOwnProperty.call(source, key)) { | |
target[key] = source[key] | |
} | |
} | |
} | |
return target | |
} | |
},{}],"remark-rehype":[function(require,module,exports){ | |
'use strict'; | |
var mdast2hast = require('mdast-util-to-hast'); | |
module.exports = remark2rehype; | |
/* Attacher. | |
* If a destination is given, runs the destination with | |
* the new HAST tree (bridge-mode). | |
* Without destination, returns the HAST tree: further | |
* plug-ins run on that tree (mutate-mode). */ | |
function remark2rehype(destination, options) { | |
if (destination && !destination.process) { | |
options = destination; | |
destination = null; | |
} | |
return destination ? bridge(destination, options) : mutate(options); | |
} | |
/* Bridge-mode. Runs the destination with the new HAST | |
* tree. */ | |
function bridge(destination, options) { | |
return transformer; | |
function transformer(node, file, next) { | |
destination.run(mdast2hast(node, options), file, done); | |
function done(err) { | |
next(err); | |
} | |
} | |
} | |
/* Mutate-mode. Further transformers run on the HAST tree. */ | |
function mutate(options) { | |
return transformer; | |
function transformer(node) { | |
return mdast2hast(node, options); | |
} | |
} | |
},{"mdast-util-to-hast":1}]},{},[]) | |
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2hvbWUvYWRtaW4vYnJvd3NlcmlmeS1jZG4vbm9kZV9tb2R1bGVzL2Jyb3dzZXJpZnkvbm9kZV9tb2R1bGVzL2Jyb3dzZXItcGFjay9fcHJlbHVkZS5qcyIsIm5vZGVfbW9kdWxlcy9tZGFzdC11dGlsLXRvLWhhc3QvaW5kZXguanMiLCJub2RlX21vZHVsZXMvbWRhc3QtdXRpbC10by1oYXN0L2xpYi9hbGwuanMiLCJub2RlX21vZHVsZXMvbWRhc3QtdXRpbC10by1oYXN0L2xpYi9mYWlsc2FmZS5qcyIsIm5vZGVfbW9kdWxlcy9tZGFzdC11dGlsLXRvLWhhc3QvbGliL2Zvb3Rlci5qcyIsIm5vZGVfbW9kdWxlcy9tZGFzdC11dGlsLXRvLWhhc3QvbGliL2hhbmRsZXJzL2Jsb2NrcXVvdGUuanMiLCJub2RlX21vZHVsZXMvbWRhc3QtdXRpbC10by1oYXN0L2xpYi9oYW5kbGV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dXRhdGUob3B0aW9ucykge1xuICByZXR1cm4gdHJhbnNmb3JtZXI7XG4gIGZ1bmN0aW9uIHRyYW5zZm9ybWVyKG5vZGUpIHtcbiAgICByZXR1cm4gbWRhc3QyaGFzdChub2RlLCBvcHRpb25zKTtcbiAgfVxufVxuIl19 | |
require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | |
var emoji = require('emoji-regex') | |
module.exports = BananaSlug | |
function BananaSlug () { | |
var self = this | |
if (!(self instanceof BananaSlug)) return new BananaSlug() | |
self.reset() | |
} | |
/** | |
* Generate a unique slug. | |
* @param {string} value String of text to slugify | |
* @return {string} A unique slug string | |
*/ | |
BananaSlug.prototype.slug = function (value) { | |
var self = this | |
var slug = slugger(value) | |
var occurrences = self.occurrences[slug] | |
if (self.occurrences.hasOwnProperty(slug)) { | |
occurrences++ | |
} else { | |
occurrences = 0 | |
} | |
self.occurrences[slug] = occurrences | |
if (occurrences) { | |
slug = slug + '-' + occurrences | |
} | |
return slug | |
} | |
/** | |
* Reset - Forget all previous slugs | |
* @return void | |
*/ | |
BananaSlug.prototype.reset = function () { | |
this.occurrences = {} | |
} | |
var whitespace = /\s/g | |
function lower (string) { | |
return string.toLowerCase() | |
} | |
function slugger (string) { | |
var re = /[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g | |
var maintainCase = false | |
var replacement = '-' | |
if (typeof string !== 'string') return '' | |
if (!maintainCase) string = string.replace(/[A-Z]+/g, lower) | |
return string.trim() | |
.replace(re, '') | |
.replace(emoji(), '') | |
.replace(whitespace, replacement) | |
} | |
},{"emoji-regex":2}],2:[function(require,module,exports){ | |
module.exports = function() { | |
return /[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267B\u267F\u2692-\u2694\u2696\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD79\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5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DF1-\uDDF4\uDDF6-\uDDF9]|\uD83C\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uD83C\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uD83C\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uD83C\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uD83C\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uD83C\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uD83C\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uD83C\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|[#\*0-9]\u20E3/g; | |
}; | |
},{}],3:[function(require,module,exports){ | |
/** | |
* @author Titus Wormer | |
* @copyright 2016 Titus Wormer | |
* @license MIT | |
* @module hast:util:has-property | |
* @fileoverview Check whether a node has a property. | |
*/ | |
'use strict'; | |
/* eslint-env commonjs */ | |
/* | |
* Methods. | |
*/ | |
var has = Object.prototype.hasOwnProperty; | |
/** | |
* Check if `node` has `name`. | |
* | |
* @param {Node?} node - Node to check. | |
* @param {string} name - Property to check. | |
* @return {boolean} - Whether `node` has `name`. | |
*/ | |
function hasProperty(node, name) { | |
var props; | |
var value; | |
if ( | |
!node || | |
!name || | |
typeof node !== 'object' || | |
node.type !== 'element' | |
) { | |
return false; | |
} | |
props = node.properties; | |
value = props && has.call(props, name) && node.properties[name]; | |
return value !== null && value !== undefined && value !== false; | |
} | |
/* | |
* Expose. | |
*/ | |
module.exports = hasProperty; | |
},{}],4:[function(require,module,exports){ | |
/** | |
* @author Titus Wormer | |
* @copyright 2016 Titus Wormer | |
* @license MIT | |
* @module rehype:lint:util:is-element | |
*/ | |
'use strict'; | |
/* eslint-env commonjs */ | |
/** | |
* Check if a node is a (certain) element. | |
* | |
* @param {*} node - Thing to check. | |
* @param {string|Array.<string>?} [tagNames] - Name of element. | |
* @return {boolean} - Whether a node is a (certain) element. | |
* @throws {Error} - When `tagNames` is given but invalid. | |
*/ | |
function isElement(node, tagNames) { | |
var name; | |
if ( | |
!( | |
tagNames === null || | |
tagNames === undefined || | |
typeof tagNames === 'string' || | |
(typeof tagNames === 'object' && tagNames.length) | |
) | |
) { | |
throw new Error( | |
'Expected `string` or `Array.<string>` for ' + | |
'`tagNames`, not `' + tagNames + '`' | |
); | |
} | |
if ( | |
!node || | |
typeof node !== 'object' || | |
node.type !== 'element' || | |
typeof node.tagName !== 'string' | |
) { | |
return false; | |
} | |
if (tagNames === null || tagNames === undefined) { | |
return true; | |
} | |
name = node.tagName; | |
if (typeof tagNames === 'string') { | |
return name === tagNames; | |
} | |
return tagNames.indexOf(name) !== -1; | |
} | |
/* | |
* Expose. | |
*/ | |
module.exports = isElement; | |
},{}],5:[function(require,module,exports){ | |
/** | |
* @fileoverview | |
* Get the plain-text value of a HAST node. | |
* @longdescription | |
* ## Usage | |
* | |
* ```javascript | |
* var h = require('hastscript'); | |
* var toString = require('hast-util-to-string'); | |
* | |
* toString(h('p', 'Alpha')); | |
* //=> 'Alpha' | |
* toString(h('div', [h('b', 'Bold'), ' and ', h('i', 'italic'), '.'])); | |
* //=> 'Bold and italic.' | |
* ``` | |
* | |
* ## API | |
* | |
* ### `toString(node)` | |
* | |
* Transform a node to string. | |
*/ | |
'use strict'; | |
module.exports = toString; | |
function toString(node) { | |
/* “The concatenation of data of all the Text node descendants | |
* of the context object, in tree order.” */ | |
if ('children' in node) { | |
return all(node); | |
} | |
/* “Context object’s data.” */ | |
return 'value' in node ? node.value : ''; | |
} | |
function one(node) { | |
if (node.type === 'text') { | |
return node.value; | |
} | |
return node.children ? all(node) : ''; | |
} | |
function all(node) { | |
var children = node.children; | |
var length = children.length; | |
var index = -1; | |
var result = []; | |
while (++index < length) { | |
result[index] = one(children[index]); | |
} | |
return result.join(''); | |
} | |
},{}],6:[function(require,module,exports){ | |
'use strict'; | |
/* Expose. */ | |
module.exports = visit; | |
/* Visit. */ | |
function visit(tree, type, visitor, reverse) { | |
if (typeof type === 'function') { | |
reverse = visitor; | |
visitor = type; | |
type = null; | |
} | |
one(tree); | |
/* Visit a single node. */ | |
function one(node, index, parent) { | |
var result; | |
index = index || (parent ? 0 : null); | |
if (!type || node.type === type) { | |
result = visitor(node, index, parent || null); | |
} | |
if (node.children && result !== false) { | |
return all(node.children, node); | |
} | |
return result; | |
} | |
/* Visit children in `parent`. */ | |
function all(children, parent) { | |
var step = reverse ? -1 : 1; | |
var max = children.length; | |
var min = -1; | |
var index = (reverse ? max : min) + step; | |
var child; | |
while (index > min && index < max) { | |
child = children[index]; | |
if (child && one(child, index, parent) === false) { | |
return false; | |
} | |
index += step; | |
} | |
return true; | |
} | |
} | |
},{}],"rehype-slug":[function(require,module,exports){ | |
'use strict'; | |
var slugs = require('github-slugger')(); | |
var visit = require('unist-util-visit'); | |
var toString = require('hast-util-to-string'); | |
var is = require('hast-util-is-element'); | |
var has = require('hast-util-has-property'); | |
module.exports = slug; | |
var headings = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']; | |
function slug() { | |
return transformer; | |
} | |
function transformer(tree) { | |
slugs.reset(); | |
visit(tree, 'element', function (node) { | |
if (is(node, headings) && !has(node, 'id')) { | |
node.properties.id = slugs.slug(toString(node)); | |
} | |
}); | |
} | |
},{"github-slugger":1,"hast-util-has-property":3,"hast-util-is-element":4,"hast-util-to-string":5,"unist-util-visit":6}]},{},[]) | |
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJ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ERGQ118XFx1RDgzQ1xcdURERkVcXHVEODNDW1xcdURERUFcXHVEREY5XXxcXHVEODNDXFx1RERGRFxcdUQ4M0NcXHVEREYwfFxcdUQ4M0NcXHVEREZDXFx1RDgzQ1tcXHVEREVCXFx1RERGOF18XFx1RDgzQ1xcdURERkJcXHVEODNDW1xcdURERTZcXHVEREU4XFx1RERFQVxcdURERUNcXHVEREVFXFx1RERGM1xcdURERkFdfFxcdUQ4M0NcXHVEREZBXFx1RDgzQ1tcXHVEREU2XFx1RERFQ1xcdURERjJcXHVEREY4XFx1RERGRVxcdURERkZdfFxcdUQ4M0NcXHVEREY5XFx1RDgzQ1tcXHVEREU2XFx1RERFOFxcdURERTlcXHVEREVCLVxcdURERURcXHVEREVGLVxcdURERjRcXHVEREY3XFx1RERGOVxcdURERkJcXHVEREZDXFx1RERGRl18XFx1RDgzQ1xcdURERjhcXHVEODNDW1xcdURERTYtXFx1RERFQVxcdURERUMtXFx1RERGNFxcdURERjctXFx1RERGOVxcdURERkJcXHVEREZELVxcdURERkZdfFxcdUQ4M0NcXHVEREY3XFx1RDgzQ1tcXHVEREVBXFx1RERGNFxcdURERjhcXHVEREZBXFx1RERGQ118XFx1RDgzQ1xcdURERjZcXHVEODNDXFx1RERFNnxcXHVEODNDXFx1RERGNVxcdUQ4M0NbXFx1RERFNlxcdURERUEtXFx1RERFRFxcdURERjAtXFx1RERGM1xcdURERjctXFx1RERGOVxcdURERkNcXHVEREZFXXxcXHVEODNDXFx1RERGNFxcdUQ4M0NcXHVEREYyfFxcdUQ4M0NcXHVEREYzXFx1RDgzQ1tcXHVEREU2XFx1RERFOFxcdURERUEtXFx1RERFQ1xcdURERUVcXHVEREYxXFx1RERGNFxcdURERjVcXHVEREY3XFx1RERGQVxcdURERkZdfFxcdUQ4M0NcXHVEREYyXFx1RDgzQ1tcXHVEREU2XFx1RERFOC1cXHVEREVEXFx1RERGMC1cXHVEREZGXXxcXHVEODNDXFx1RERGMVxcdUQ4M0NbXFx1RERFNi1cXHVEREU4XFx1RERFRVxcdURERjBcXHVEREY3LVxcdURERkJcXHVEREZFXXxcXHVEODNDXFx1RERGMFxcdUQ4M0NbXFx1RERFQVxcdURERUMtXFx1RERFRVxcdURERjJcXHVEREYzXFx1RERGNVxcdURERjdcXHVEREZDXFx1RERGRVxcdURERkZdfFxcdUQ4M0NcXHVEREVGXFx1RDgzQ1tcXHVEREVBXFx1RERGMlxcdURERjRcXHVEREY1XXxcXHVEODNDXFx1RERFRVxcdUQ4M0NbXFx1RERFOC1cXHVEREVBXFx1RERGMS1cXHVEREY0XFx1RERGNi1cXHVEREY5XXxcXHVEODNDXFx1RERFRFxcdUQ4M0NbXFx1RERGMFxcdURERjJcXHVEREYzXFx1RERGN1xcdURERjlcXHVEREZBXXxcXHVEODNDXFx1RERFQ1xcdUQ4M0NbXFx1RERFNlxcdURERTdcXHVEREU5LVxcdURERUVcXHVEREYxLVxcdURERjNcXHVEREY1LVxcdURERkFcXHVEREZDXFx1RERGRV18XFx1RDgzQ1xcdURERUJcXHVEODNDW1xcdURERUUtXFx1RERGMFxcdURERjJcXHVEREY0XFx1RERGN118XFx1RDgzQ1xcdURERUFcXHVEODNDW1xcdURERTZcXHVEREU4XFx1RERFQVxcdURERUNcXHVEREVEXFx1RERGNy1cXHVEREZBXXxcXHVEODNDXFx1RERFOVxcdUQ4M0NbXFx1RERFQVxcdURERUNcXHVEREVGXFx1RERGMFxcdURERjJcXHVEREY0XFx1RERGRl18XFx1RDgzQ1xcdURERThcXHVEODNDW1xcdURERTZcXHVEREU4XFx1RERFOVxcdURERUItXFx1RERFRVxcdURERjAtXFx1RERGNVxcdURERjdcXHVEREZBLVxcdURERkZdfFxcdUQ4M0NcXHVEREU3XFx1RDgzQ1tcXHVEREU2XFx1RERFN1xcdURERTktXFx1RERFRlxcdURERjEtXFx1RERGNFxcdURERjYtXFx1RERGOVxcdURERkJcXHVEREZDXFx1RERGRVxcdURERkZdfFxcdUQ4M0NcXHVEREU2XFx1RDgzQ1tc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3J0cyA9IHNsdWc7XG5cbnZhciBoZWFkaW5ncyA9IFsnaDEnLCAnaDInLCAnaDMnLCAnaDQnLCAnaDUnLCAnaDYnXTtcblxuZnVuY3Rpb24gc2x1ZygpIHtcbiAgcmV0dXJuIHRyYW5zZm9ybWVyO1xufVxuXG5mdW5jdGlvbiB0cmFuc2Zvcm1lcih0cmVlKSB7XG4gIHNsdWdzLnJlc2V0KCk7XG5cbiAgdmlzaXQodHJlZSwgJ2VsZW1lbnQnLCBmdW5jdGlvbiAobm9kZSkge1xuICAgIGlmIChpcyhub2RlLCBoZWFkaW5ncykgJiYgIWhhcyhub2RlLCAnaWQnKSkge1xuICAgICAgbm9kZS5wcm9wZXJ0aWVzLmlkID0gc2x1Z3Muc2x1Zyh0b1N0cmluZyhub2RlKSk7XG4gICAgfVxuICB9KTtcbn1cbiJdfQ== | |
require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | |
/** | |
* @author Titus Wormer | |
* @copyright 2016 Titus Wormer | |
* @license MIT | |
* @module hast:util:has-property | |
* @fileoverview Check whether a node has a property. | |
*/ | |
'use strict'; | |
/* eslint-env commonjs */ | |
/* | |
* Methods. | |
*/ | |
var has = Object.prototype.hasOwnProperty; | |
/** | |
* Check if `node` has `name`. | |
* | |
* @param {Node?} node - Node to check. | |
* @param {string} name - Property to check. | |
* @return {boolean} - Whether `node` has `name`. | |
*/ | |
function hasProperty(node, name) { | |
var props; | |
var value; | |
if ( | |
!node || | |
!name || | |
typeof node !== 'object' || | |
node.type !== 'element' | |
) { | |
return false; | |
} | |
props = node.properties; | |
value = props && has.call(props, name) && node.properties[name]; | |
return value !== null && value !== undefined && value !== false; | |
} | |
/* | |
* Expose. | |
*/ | |
module.exports = hasProperty; | |
},{}],2:[function(require,module,exports){ | |
/** | |
* @author Titus Wormer | |
* @copyright 2016 Titus Wormer | |
* @license MIT | |
* @module rehype:lint:util:is-element | |
*/ | |
'use strict'; | |
/* eslint-env commonjs */ | |
/** | |
* Check if a node is a (certain) element. | |
* | |
* @param {*} node - Thing to check. | |
* @param {string|Array.<string>?} [tagNames] - Name of element. | |
* @return {boolean} - Whether a node is a (certain) element. | |
* @throws {Error} - When `tagNames` is given but invalid. | |
*/ | |
function isElement(node, tagNames) { | |
var name; | |
if ( | |
!( | |
tagNames === null || | |
tagNames === undefined || | |
typeof tagNames === 'string' || | |
(typeof tagNames === 'object' && tagNames.length) | |
) | |
) { | |
throw new Error( | |
'Expected `string` or `Array.<string>` for ' + | |
'`tagNames`, not `' + tagNames + '`' | |
); | |
} | |
if ( | |
!node || | |
typeof node !== 'object' || | |
node.type !== 'element' || | |
typeof node.tagName !== 'string' | |
) { | |
return false; | |
} | |
if (tagNames === null || tagNames === undefined) { | |
return true; | |
} | |
name = node.tagName; | |
if (typeof tagNames === 'string') { | |
return name === tagNames; | |
} | |
return tagNames.indexOf(name) !== -1; | |
} | |
/* | |
* Expose. | |
*/ | |
module.exports = isElement; | |
},{}],3:[function(require,module,exports){ | |
'use strict'; | |
/* Expose. */ | |
module.exports = visit; | |
/* Visit. */ | |
function visit(tree, type, visitor, reverse) { | |
if (typeof type === 'function') { | |
reverse = visitor; | |
visitor = type; | |
type = null; | |
} | |
one(tree); | |
/* Visit a single node. */ | |
function one(node, index, parent) { | |
var result; | |
index = index || (parent ? 0 : null); | |
if (!type || node.type === type) { | |
result = visitor(node, index, parent || null); | |
} | |
if (node.children && result !== false) { | |
return all(node.children, node); | |
} | |
return result; | |
} | |
/* Visit children in `parent`. */ | |
function all(children, parent) { | |
var step = reverse ? -1 : 1; | |
var max = children.length; | |
var min = -1; | |
var index = (reverse ? max : min) + step; | |
var child; | |
while (index > min && index < max) { | |
child = children[index]; | |
if (child && one(child, index, parent) === false) { | |
return false; | |
} | |
index += step; | |
} | |
return true; | |
} | |
} | |
},{}],4:[function(require,module,exports){ | |
module.exports = extend | |
var hasOwnProperty = Object.prototype.hasOwnProperty; | |
function extend() { | |
var target = {} | |
for (var i = 0; i < arguments.length; i++) { | |
var source = arguments[i] | |
for (var key in source) { | |
if (hasOwnProperty.call(source, key)) { | |
target[key] = source[key] | |
} | |
} | |
} | |
return target | |
} | |
},{}],"rehype-autolink-headings":[function(require,module,exports){ | |
'use strict'; | |
var xtend = require('xtend'); | |
var visit = require('unist-util-visit'); | |
var has = require('hast-util-has-property'); | |
var is = require('hast-util-is-element'); | |
module.exports = autolink; | |
var headings = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']; | |
var methods = {prepend: 'unshift', append: 'push'}; | |
var contentDefaults = { | |
type: 'element', | |
tagName: 'span', | |
properties: {className: ['icon', 'icon-link']} | |
}; | |
function autolink(options) { | |
var settings = options || {}; | |
var props = settings.properties; | |
var behavior = settings.behaviour || settings.behavior || 'prepend'; | |
var content = settings.content || contentDefaults; | |
var fn = behavior === 'wrap' ? wrap : inject; | |
if (behavior !== 'wrap' && !props) { | |
props = {ariaHidden: true}; | |
} | |
if (content && typeof content === 'object' && !('length' in content)) { | |
content = [content]; | |
} | |
return transformer; | |
function transformer(tree) { | |
visit(tree, visitor); | |
} | |
function visitor(node) { | |
if (is(node, headings) && has(node, 'id')) { | |
fn(node); | |
} | |
} | |
function wrap(node) { | |
var child = icon(node); | |
child.children = node.children; | |
node.children = [child]; | |
} | |
function inject(node) { | |
var child = icon(node); | |
child.children = content.concat(); | |
node.children[methods[behavior]](child); | |
} | |
function icon(node) { | |
return { | |
type: 'element', | |
tagName: 'a', | |
properties: xtend(props, {href: '#' + node.properties.id}) | |
}; | |
} | |
} | |
},{"hast-util-has-property":1,"hast-util-is-element":2,"unist-util-visit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29uKG5vZGUpO1xuICAgIGNoaWxkLmNoaWxkcmVuID0gY29udGVudC5jb25jYXQoKTtcbiAgICBub2RlLmNoaWxkcmVuW21ldGhvZHNbYmVoYXZpb3JdXShjaGlsZCk7XG4gIH1cblxuICBmdW5jdGlvbiBpY29uKG5vZGUpIHtcbiAgICByZXR1cm4ge1xuICAgICAgdHlwZTogJ2VsZW1lbnQnLFxuICAgICAgdGFnTmFtZTogJ2EnLFxuICAgICAgcHJvcGVydGllczogeHRlbmQocHJvcHMsIHtocmVmOiAnIycgKyBub2RlLnByb3BlcnRpZXMuaWR9KVxuICAgIH07XG4gIH1cbn1cbiJdfQ== | |
require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | |
'use strict'; | |
/* Dependencies. */ | |
var Parser = require('parse5/lib/parser'); | |
var pos = require('unist-util-position'); | |
var fromParse5 = require('hast-util-from-parse5'); | |
var toParse5 = require('hast-util-to-parse5'); | |
var voids = require('html-void-elements'); | |
var ns = require('web-namespaces'); | |
var zwitch = require('zwitch'); | |
/* Expose. */ | |
module.exports = wrap; | |
/* Constants. */ | |
var IN_TEMPLATE_MODE = 'IN_TEMPLATE_MODE'; | |
var CHARACTER_TOKEN = 'CHARACTER_TOKEN'; | |
var START_TAG_TOKEN = 'START_TAG_TOKEN'; | |
var END_TAG_TOKEN = 'END_TAG_TOKEN'; | |
var HIBERNATION_TOKEN = 'HIBERNATION_TOKEN'; | |
var COMMENT_TOKEN = 'COMMENT_TOKEN'; | |
var DOCTYPE_TOKEN = 'DOCTYPE_TOKEN'; | |
var DOCUMENT = 'document'; | |
var FRAGMENT = 'fragment'; | |
function wrap(tree, file) { | |
var parser = new Parser({locationInfo: true}); | |
var one = zwitch('type'); | |
var mode = inferMode(tree); | |
var preprocessor; | |
var result; | |
one.handlers.root = root; | |
one.handlers.element = element; | |
one.handlers.text = text; | |
one.handlers.comment = comment; | |
one.handlers.doctype = doctype; | |
one.handlers.raw = raw; | |
one.unknown = unknown; | |
result = fromParse5(mode === FRAGMENT ? fragment() : document(), file); | |
/* Unpack if possible and when not given a `root`. */ | |
if (tree.type !== 'root' && result.children.length === 1) { | |
return result.children[0]; | |
} | |
return result; | |
function fragment() { | |
var context; | |
var mock; | |
var doc; | |
context = { | |
nodeName: 'template', | |
tagName: 'template', | |
attrs: [], | |
namespaceURI: ns.html, | |
childNodes: [] | |
}; | |
mock = { | |
nodeName: 'documentmock', | |
tagName: 'documentmock', | |
attrs: [], | |
namespaceURI: ns.html, | |
childNodes: [] | |
}; | |
doc = { | |
nodeName: '#document-fragment', | |
childNodes: [] | |
}; | |
parser._bootstrap(mock, context); | |
parser._pushTmplInsertionMode(IN_TEMPLATE_MODE); | |
parser._initTokenizerForFragmentParsing(); | |
parser._insertFakeRootElement(); | |
parser._resetInsertionMode(); | |
parser._findFormInFragmentContext(); | |
preprocessor = parser.tokenizer.preprocessor; | |
one(tree); | |
parser._adoptNodes(mock.childNodes[0], doc); | |
return doc; | |
} | |
function document() { | |
var doc = parser.treeAdapter.createDocument(); | |
parser._bootstrap(doc, null); | |
one(tree); | |
return doc; | |
} | |
function all(nodes) { | |
var length = nodes.length; | |
var index = -1; | |
while (++index < length) { | |
one(nodes[index]); | |
} | |
} | |
function root(node) { | |
all(node.children); | |
} | |
function element(node) { | |
var empty = voids.indexOf(node.tagName) !== -1; | |
parser._processToken(startTag(node, empty), ns.html); | |
all(node.children); | |
if (!empty) { | |
parser._processToken(endTag(node)); | |
} | |
} | |
function text(node) { | |
parser._processToken({ | |
type: CHARACTER_TOKEN, | |
chars: node.value, | |
location: { | |
line: pos.start(node).line, | |
col: pos.start(node).column, | |
startOffset: pos.start(node).offset, | |
endOffset: pos.end(node).offset | |
} | |
}); | |
} | |
function doctype(node) { | |
var p5 = toParse5(node); | |
parser._processToken({ | |
type: DOCTYPE_TOKEN, | |
name: p5.name, | |
forceQuirks: false, | |
publicId: p5.publicId, | |
systemId: p5.systemId | |
}); | |
} | |
function comment(node) { | |
parser._processToken({ | |
type: COMMENT_TOKEN, | |
data: node.value, | |
location: { | |
line: pos.start(node).line, | |
col: pos.start(node).column, | |
startOffset: pos.start(node).offset, | |
endOffset: pos.end(node).offset | |
} | |
}); | |
} | |
function raw(node) { | |
var start = pos.start(node).offset; | |
preprocessor.html = null; | |
preprocessor.lastCharPos = -1; | |
preprocessor.pos = -1; | |
if (start !== null) { | |
preprocessor.droppedBufferSize = start; | |
} | |
parser.tokenizer.write(node.value); | |
run(parser); | |
} | |
} | |
function run(p) { | |
var tokenizer = p.tokenizer; | |
var token; | |
while (!p.stopped) { | |
p._setupTokenizerCDATAMode(); | |
token = tokenizer.getNextToken(); | |
if (token.type === HIBERNATION_TOKEN) { | |
token = tokenizer.currentCharacterToken || tokenizer.currentToken; | |
if (token) { | |
p._processInputToken(token); | |
} | |
tokenizer.currentToken = null; | |
tokenizer.currentCharacterToken = null; | |
break; | |
} | |
p._processInputToken(token); | |
} | |
} | |
function startTag(node, empty) { | |
var start = pos.start(node); | |
return { | |
type: START_TAG_TOKEN, | |
tagName: node.tagName, | |
selfClosing: false, | |
attrs: attributes(node), | |
location: { | |
line: start.line, | |
col: start.column, | |
startOffset: start.offset, | |
endOffset: start.offset, | |
attrs: {}, | |
startTag: { | |
line: start.line, | |
col: start.column, | |
startOffset: start.offset, | |
endOffset: empty ? pos.end(node).offset : start.offset | |
} | |
} | |
}; | |
} | |
function attributes(node) { | |
return toParse5({ | |
type: 'element', | |
properties: node.properties | |
}).attrs; | |
} | |
function endTag(node) { | |
var end = pos.end(node); | |
return { | |
type: END_TAG_TOKEN, | |
tagName: node.tagName, | |
attrs: [], | |
location: { | |
line: end.line, | |
col: end.column, | |
startOffset: end.offset, | |
endOffset: end.offset | |
} | |
}; | |
} | |
function unknown(node) { | |
throw new Error('Cannot compile `' + node.type + '` node'); | |
} | |
function inferMode(node) { | |
var head = node.type === 'root' ? node.children[0] : node; | |
if (head && (head.type === 'doctype' || head.tagName === 'html')) { | |
return DOCUMENT; | |
} | |
return FRAGMENT; | |
} | |
},{"hast-util-from-parse5":2,"hast-util-to-parse5":12,"html-void-elements":31,"parse5/lib/parser":40,"unist-util-position":46,"web-namespaces":47,"zwitch":48}],2:[function(require,module,exports){ | |
'use strict'; | |
var information = require('property-information'); | |
var camelcase = require('camelcase'); | |
var vfileLocation = require('vfile-location'); | |
var h = require('hastscript'); | |
module.exports = wrapper; | |
var own = {}.hasOwnProperty; | |
/* Handlers. */ | |
var map = { | |
'#document': root, | |
'#document-fragment': root, | |
'#text': text, | |
'#comment': comment, | |
'#documentType': doctype | |
}; | |
/* Wrapper to normalise options. */ | |
function wrapper(ast, options) { | |
var settings = options || {}; | |
var file; | |
if (settings.messages) { | |
file = settings; | |
settings = {}; | |
} else { | |
file = settings.file; | |
} | |
return transform(ast, { | |
file: file, | |
toPosition: file ? vfileLocation(file).toPosition : null, | |
verbose: settings.verbose, | |
location: false | |
}); | |
} | |
/* Transform a node. */ | |
function transform(ast, config) { | |
var fn = own.call(map, ast.nodeName) ? map[ast.nodeName] : element; | |
var children; | |
var node; | |
var position; | |
if (ast.childNodes) { | |
children = nodes(ast.childNodes, config); | |
} | |
node = fn(ast, children, config); | |
if (ast.__location && config.toPosition) { | |
config.location = true; | |
position = location(ast.__location, ast, node, config); | |
if (position) { | |
node.position = position; | |
} | |
} | |
return node; | |
} | |
/* Transform children. */ | |
function nodes(children, config) { | |
var length = children.length; | |
var index = -1; | |
var result = []; | |
while (++index < length) { | |
result[index] = transform(children[index], config); | |
} | |
return result; | |
} | |
/* Transform a document. | |
* Stores `ast.quirksMode` in `node.data.quirksMode`. */ | |
function root(ast, children, config) { | |
var quirks = ast.mode === 'quirks' || ast.mode === 'limited-quirks'; | |
var node = {type: 'root', children: children}; | |
var position; | |
node.data = {quirksMode: quirks}; | |
if (ast.__location) { | |
if (config.toPosition) { | |
config.location = true; | |
position = ast.__location; | |
} | |
} else if (config.file && config.location) { | |
position = {startOffset: 0, endOffset: String(config.file).length}; | |
} | |
position = position && location(position, ast, node, config); | |
if (position) { | |
node.position = position; | |
} | |
return node; | |
} | |
/* Transform a doctype. */ | |
function doctype(ast) { | |
return { | |
type: 'doctype', | |
name: ast.name || '', | |
public: ast.publicId || null, | |
system: ast.systemId || null | |
}; | |
} | |
/* Transform a text. */ | |
function text(ast) { | |
return {type: 'text', value: ast.value}; | |
} | |
/* Transform a comment. */ | |
function comment(ast) { | |
return {type: 'comment', value: ast.data}; | |
} | |
/* Transform an element. */ | |
function element(ast, children, config) { | |
var props = {}; | |
var values = ast.attrs; | |
var length = values.length; | |
var index = -1; | |
var attr; | |
var node; | |
var fragment; | |
while (++index < length) { | |
attr = values[index]; | |
props[(attr.prefix ? attr.prefix + ':' : '') + attr.name] = attr.value; | |
} | |
node = h(ast.tagName, props, children); | |
if (ast.nodeName === 'template' && 'content' in ast) { | |
fragment = ast.content; | |
if (ast.__location) { | |
fragment.__location = { | |
startOffset: ast.__location.startTag.endOffset, | |
endOffset: ast.__location.endTag.startOffset | |
}; | |
} | |
node.content = transform(ast.content, config); | |
} | |
return node; | |
} | |
/* Create clean positional information. */ | |
function loc(toPosition, dirty) { | |
return { | |
start: toPosition(dirty.startOffset), | |
end: toPosition(dirty.endOffset) | |
}; | |
} | |
/* Create clean positional information. */ | |
function location(info, ast, node, config) { | |
var start = info.startOffset; | |
var end = info.endOffset; | |
var values = info.attrs || {}; | |
var propPositions = {}; | |
var prop; | |
var name; | |
var reference; | |
for (prop in values) { | |
name = (information(prop) || {}).propertyName || camelcase(prop); | |
propPositions[name] = loc(config.toPosition, values[prop]); | |
} | |
/* Upstream: https://github.com/inikulin/parse5/issues/109 */ | |
if (node.type === 'element' && !info.endTag) { | |
reference = node.children[node.children.length - 1]; | |
/* Unclosed with children: */ | |
if (reference && reference.position) { | |
if (reference.position.end) { | |
end = reference.position.end.offset; | |
} else { | |
end = null; | |
} | |
/* Unclosed without children: */ | |
} else if (info.startTag) { | |
end = info.startTag.endOffset; | |
} | |
} | |
if (config.verbose && node.type === 'element') { | |
node.data = { | |
position: { | |
opening: loc(config.toPosition, info.startTag || info), | |
closing: info.endTag ? loc(config.toPosition, info.endTag) : null, | |
properties: propPositions | |
} | |
}; | |
} | |
start = typeof start === 'number' ? config.toPosition(start) : null; | |
end = typeof end === 'number' ? config.toPosition(end) : null; | |
if (!start && !end) { | |
return undefined; | |
} | |
return {start: start, end: end}; | |
} | |
},{"camelcase":3,"hastscript":4,"property-information":10,"vfile-location":11}],3:[function(require,module,exports){ | |
'use strict'; | |
function preserveCamelCase(str) { | |
var isLastCharLower = false; | |
for (var i = 0; i < str.length; i++) { | |
var c = str.charAt(i); | |
if (isLastCharLower && (/[a-zA-Z]/).test(c) && c.toUpperCase() === c) { | |
str = str.substr(0, i) + '-' + str.substr(i); | |
isLastCharLower = false; | |
i++; | |
} else { | |
isLastCharLower = (c.toLowerCase() === c); | |
} | |
} | |
return str; | |
} | |
module.exports = function () { | |
var str = [].map.call(arguments, function (str) { | |
return str.trim(); | |
}).filter(function (str) { | |
return str.length; | |
}).join('-'); | |
if (!str.length) { | |
return ''; | |
} | |
if (str.length === 1) { | |
return str.toLowerCase(); | |
} | |
if (!(/[_.\- ]+/).test(str)) { | |
if (str === str.toUpperCase()) { | |
return str.toLowerCase(); | |
} | |
if (str[0] !== str[0].toLowerCase()) { | |
return str[0].toLowerCase() + str.slice(1); | |
} | |
return str; | |
} | |
str = preserveCamelCase(str); | |
return str | |
.replace(/^[_.\- ]+/, '') | |
.toLowerCase() | |
.replace(/[_.\- ]+(\w|$)/g, function (m, p1) { | |
return p1.toUpperCase(); | |
}); | |
}; | |
},{}],4:[function(require,module,exports){ | |
'use strict'; | |
var parseSelector = require('hast-util-parse-selector'); | |
var camelcase = require('camelcase'); | |
var propertyInformation = require('property-information'); | |
var spaces = require('space-separated-tokens').parse; | |
var commas = require('comma-separated-tokens').parse; | |
module.exports = h; | |
/* Hyperscript compatible DSL for creating virtual HAST | |
* trees. */ | |
function h(selector, properties, children) { | |
var node = parseSelector(selector); | |
var property; | |
if ( | |
properties && | |
!children && | |
( | |
typeof properties === 'string' || | |
'length' in properties || | |
isNode(node.tagName, properties) | |
) | |
) { | |
children = properties; | |
properties = null; | |
} | |
if (properties) { | |
for (property in properties) { | |
addProperty(node.properties, property, properties[property]); | |
} | |
} | |
addChild(node.children, children); | |
if (node.tagName === 'template') { | |
node.content = {type: 'root', children: node.children}; | |
node.children = []; | |
} | |
return node; | |
} | |
/* Check if `value` is a valid child node of `tagName`. */ | |
function isNode(tagName, value) { | |
var type = value.type; | |
if (typeof type === 'string') { | |
type = type.toLowerCase(); | |
} | |
if (tagName === 'input' || !type || typeof type !== 'string') { | |
return false; | |
} | |
if (typeof value.children === 'object' && 'length' in value.children) { | |
return true; | |
} | |
if (tagName === 'button') { | |
return type !== 'menu' && | |
type !== 'submit' && | |
type !== 'reset' && | |
type !== 'button'; | |
} | |
return 'value' in value; | |
} | |
/* Add `value` as a child to `nodes`. */ | |
function addChild(nodes, value) { | |
var index; | |
var length; | |
if (value === null || value === undefined) { | |
return; | |
} | |
if (typeof value === 'string' || typeof value === 'number') { | |
value = {type: 'text', value: String(value)}; | |
} | |
if (typeof value === 'object' && 'length' in value) { | |
index = -1; | |
length = value.length; | |
while (++index < length) { | |
addChild(nodes, value[index]); | |
} | |
return; | |
} | |
if (typeof value !== 'object' || !('type' in value)) { | |
throw new Error('Expected node, nodes, or string, got `' + value + '`'); | |
} | |
nodes.push(value); | |
} | |
/* Add `name` and its `value` to `properties`. `properties` can | |
* be prefilled by `parseSelector`: it can have `id` and `className` | |
* properties. */ | |
function addProperty(properties, name, value) { | |
var info = propertyInformation(name) || {}; | |
var result = value; | |
var key; | |
/* Ignore nully and NaN values. */ | |
if (value === null || value === undefined || value !== value) { | |
return; | |
} | |
/* Handle values. */ | |
if (name === 'style') { | |
/* Accept `object`. */ | |
if (typeof value !== 'string') { | |
result = []; | |
for (key in value) { | |
result.push([key, value[key]].join(': ')); | |
} | |
result = result.join('; '); | |
} | |
} else if (info.spaceSeparated) { | |
/* Accept both `string` and `Array`. */ | |
result = typeof value === 'string' ? spaces(result) : result; | |
/* Class-names (which can be added both on | |
* the `selector` and here). */ | |
if (name === 'class' && properties.className) { | |
result = properties.className.concat(result); | |
} | |
} else if (info.commaSeparated) { | |
/* Accept both `string` and `Array`. */ | |
result = typeof value === 'string' ? commas(result) : result; | |
} | |
result = parsePrimitive(info, name, result); | |
properties[info.propertyName || camelcase(name)] = result; | |
} | |
/* Parse a (list of) primitives. */ | |
function parsePrimitive(info, name, value) { | |
var result = value; | |
var index; | |
var length; | |
if (typeof value === 'object' && 'length' in value) { | |
length = value.length; | |
index = -1; | |
result = []; | |
while (++index < length) { | |
result[index] = parsePrimitive(info, name, value[index]); | |
} | |
return result; | |
} | |
if (info.numeric || info.positiveNumeric) { | |
if (!isNaN(result) && result !== '') { | |
result = Number(result); | |
} | |
} else if (info.boolean || info.overloadedBoolean) { | |
/* Accept `boolean` and `string`. */ | |
if ( | |
typeof result === 'string' && | |
(result === '' || value.toLowerCase() === name) | |
) { | |
result = true; | |
} | |
} | |
return result; | |
} | |
},{"camelcase":3,"comma-separated-tokens":5,"hast-util-parse-selector":7,"property-information":10,"space-separated-tokens":8}],5:[function(require,module,exports){ | |
'use strict'; | |
exports.parse = parse; | |
exports.stringify = stringify; | |
var trim = require('trim'); | |
var C_COMMA = ','; | |
var C_SPACE = ' '; | |
var EMPTY = ''; | |
/* Parse comma-separated tokens to an array. */ | |
function parse(value) { | |
var values = []; | |
var input = String(value || EMPTY); | |
var index = input.indexOf(C_COMMA); | |
var lastIndex = 0; | |
var end = false; | |
var val; | |
while (!end) { | |
if (index === -1) { | |
index = input.length; | |
end = true; | |
} | |
val = trim(input.slice(lastIndex, index)); | |
if (val || !end) { | |
values.push(val); | |
} | |
lastIndex = index + 1; | |
index = input.indexOf(C_COMMA, lastIndex); | |
} | |
return values; | |
} | |
/* Compile an array to comma-separated tokens. | |
* `options.padLeft` (default: `true`) pads a space left of each | |
* token, and `options.padRight` (default: `false`) pads a space | |
* to the right of each token. */ | |
function stringify(values, options) { | |
var settings = options || {}; | |
var left = settings.padLeft; | |
/* Ensure the last empty entry is seen. */ | |
if (values[values.length - 1] === EMPTY) { | |
values = values.concat(EMPTY); | |
} | |
return trim(values.join( | |
(settings.padRight ? C_SPACE : EMPTY) + | |
C_COMMA + | |
(left || left === undefined || left === null ? C_SPACE : EMPTY) | |
)); | |
} | |
},{"trim":6}],6:[function(require,module,exports){ | |
exports = module.exports = trim; | |
function trim(str){ | |
return str.replace(/^\s*|\s*$/g, ''); | |
} | |
exports.left = function(str){ | |
return str.replace(/^\s*/, ''); | |
}; | |
exports.right = function(str){ | |
return str.replace(/\s*$/, ''); | |
}; | |
},{}],7:[function(require,module,exports){ | |
'use strict'; | |
/* Expose. */ | |
module.exports = parse; | |
/* Characters */ | |
var dot = '.'.charCodeAt(0); | |
var hash = '#'.charCodeAt(0); | |
/* Parse a simple CSS selector into a HAST node. */ | |
function parse(selector) { | |
var id = null; | |
var className = []; | |
var value = selector || ''; | |
var name = 'div'; | |
var node; | |
var type = null; | |
var index = -1; | |
var code; | |
var length = value.length; | |
var subvalue; | |
var lastIndex; | |
node = { | |
type: 'element', | |
tagName: null, | |
properties: {}, | |
children: [] | |
}; | |
type = null; | |
while (++index <= length) { | |
code = value.charCodeAt(index); | |
if (!code || code === dot || code === hash) { | |
subvalue = value.slice(lastIndex, index); | |
if (subvalue) { | |
if (type === dot) { | |
className.push(subvalue); | |
} else if (type === hash) { | |
id = subvalue; | |
} else { | |
name = subvalue; | |
} | |
} | |
lastIndex = index + 1; | |
type = code; | |
} | |
} | |
node.tagName = name; | |
if (id) { | |
node.properties.id = id; | |
} | |
if (className.length !== 0) { | |
node.properties.className = className; | |
} | |
return node; | |
} | |
},{}],8:[function(require,module,exports){ | |
'use strict'; | |
var trim = require('trim'); | |
exports.parse = parse; | |
exports.stringify = stringify; | |
var empty = ''; | |
var space = ' '; | |
var whiteSpace = /[ \t\n\r\f]+/g; | |
function parse(value) { | |
var input = trim(String(value || empty)); | |
if (input === empty) { | |
return []; | |
} | |
return input.split(whiteSpace); | |
} | |
function stringify(values) { | |
return trim(values.join(space)); | |
} | |
},{"trim":9}],9:[function(require,module,exports){ | |
arguments[4][6][0].apply(exports,arguments) | |
},{"dup":6}],10:[function(require,module,exports){ | |
'use strict'; | |
/* Expose. */ | |
module.exports = getPropertyInformation; | |
/* Constants. */ | |
var USE_ATTRIBUTE = 0x1; | |
var USE_PROPERTY = 0x2; | |
var BOOLEAN_VALUE = 0x8; | |
var NUMERIC_VALUE = 0x10; | |
var POSITIVE_NUMERIC_VALUE = 0x20 | 0x10; | |
var OVERLOADED_BOOLEAN_VALUE = 0x40; | |
var SPACE_SEPARATED = 0x80; | |
var COMMA_SEPARATED = 0x100; | |
/* Map of properties. Names are camel-cased properties. */ | |
var propertyConfig = { | |
/* Standard Properties. */ | |
abbr: null, | |
accept: COMMA_SEPARATED, | |
acceptCharset: SPACE_SEPARATED, | |
accessKey: SPACE_SEPARATED, | |
action: null, | |
allowFullScreen: USE_ATTRIBUTE | BOOLEAN_VALUE, | |
allowTransparency: USE_ATTRIBUTE, | |
alt: null, | |
/* https://html.spec.whatwg.org/#attr-link-as */ | |
as: null, | |
async: BOOLEAN_VALUE, | |
autoComplete: SPACE_SEPARATED, | |
autoFocus: BOOLEAN_VALUE, | |
autoPlay: BOOLEAN_VALUE, | |
capture: USE_ATTRIBUTE | BOOLEAN_VALUE, | |
cellPadding: null, | |
cellSpacing: null, | |
challenge: USE_ATTRIBUTE, | |
charSet: USE_ATTRIBUTE, | |
checked: USE_PROPERTY | BOOLEAN_VALUE, | |
cite: null, | |
/* To set className on SVG elements, it's necessary to | |
* use .setAttribute; this works on HTML elements too | |
* in all browsers except IE8. */ | |
className: USE_ATTRIBUTE | SPACE_SEPARATED, | |
cols: USE_ATTRIBUTE | POSITIVE_NUMERIC_VALUE, | |
colSpan: null, | |
command: null, | |
content: null, | |
contentEditable: null, | |
contextMenu: USE_ATTRIBUTE, | |
controls: USE_PROPERTY | BOOLEAN_VALUE, | |
/* https://github.com/WICG/controls-list/blob/gh-pages/explainer.md */ | |
controlsList: SPACE_SEPARATED, | |
coords: NUMERIC_VALUE | COMMA_SEPARATED, | |
crossOrigin: null, | |
/* For `<object />` acts as `src`. */ | |
data: null, | |
dateTime: USE_ATTRIBUTE, | |
default: BOOLEAN_VALUE, | |
defer: BOOLEAN_VALUE, | |
dir: null, | |
dirName: null, | |
disabled: USE_ATTRIBUTE | BOOLEAN_VALUE, | |
download: OVERLOADED_BOOLEAN_VALUE, | |
draggable: null, | |
dropzone: SPACE_SEPARATED, | |
encType: null, | |
form: USE_ATTRIBUTE, | |
formAction: USE_ATTRIBUTE, | |
formEncType: USE_ATTRIBUTE, | |
formMethod: USE_ATTRIBUTE, | |
formNoValidate: BOOLEAN_VALUE, | |
formTarget: USE_ATTRIBUTE, | |
frameBorder: USE_ATTRIBUTE, | |
headers: SPACE_SEPARATED, | |
height: USE_ATTRIBUTE | POSITIVE_NUMERIC_VALUE, | |
hidden: USE_ATTRIBUTE | BOOLEAN_VALUE, | |
high: NUMERIC_VALUE, | |
href: null, | |
hrefLang: null, | |
htmlFor: SPACE_SEPARATED, | |
httpEquiv: SPACE_SEPARATED, | |
id: USE_PROPERTY, | |
inputMode: USE_ATTRIBUTE, | |
/* Web Components */ | |
is: USE_ATTRIBUTE, | |
isMap: BOOLEAN_VALUE, | |
keyParams: USE_ATTRIBUTE, | |
keyType: USE_ATTRIBUTE, | |
kind: null, | |
label: null, | |
lang: null, | |
list: USE_ATTRIBUTE, | |
loop: USE_PROPERTY | BOOLEAN_VALUE, | |
low: NUMERIC_VALUE, | |
manifest: USE_ATTRIBUTE, | |
marginHeight: NUMERIC_VALUE, | |
marginWidth: NUMERIC_VALUE, | |
max: null, | |
maxLength: USE_ATTRIBUTE | POSITIVE_NUMERIC_VALUE, | |
media: USE_ATTRIBUTE, | |
mediaGroup: null, | |
menu: null, | |
method: null, | |
min: null, | |
minLength: USE_ATTRIBUTE | POSITIVE_NUMERIC_VALUE, | |
multiple: USE_PROPERTY | BOOLEAN_VALUE, | |
muted: USE_PROPERTY | BOOLEAN_VALUE, | |
name: null, | |
nonce: null, | |
noValidate: BOOLEAN_VALUE, | |
open: BOOLEAN_VALUE, | |
optimum: NUMERIC_VALUE, | |
pattern: null, | |
ping: SPACE_SEPARATED, | |
placeholder: null, | |
/* https://html.spec.whatwg.org/#attr-video-playsinline */ | |
playsInline: BOOLEAN_VALUE, | |
poster: null, | |
preload: null, | |
/* https://html.spec.whatwg.org/#dom-head-profile */ | |
profile: null, | |
radioGroup: null, | |
readOnly: USE_PROPERTY | BOOLEAN_VALUE, | |
/* https://html.spec.whatwg.org/#attr-link-referrerpolicy */ | |
referrerPolicy: null, | |
/* `rel` is `relList` in DOM */ | |
rel: SPACE_SEPARATED | USE_ATTRIBUTE, | |
required: BOOLEAN_VALUE, | |
reversed: BOOLEAN_VALUE, | |
role: USE_ATTRIBUTE, | |
rows: USE_ATTRIBUTE | POSITIVE_NUMERIC_VALUE, | |
rowSpan: POSITIVE_NUMERIC_VALUE, | |
sandbox: SPACE_SEPARATED, | |
scope: null, | |
scoped: BOOLEAN_VALUE, | |
scrolling: null, | |
seamless: USE_ATTRIBUTE | BOOLEAN_VALUE, | |
selected: USE_PROPERTY | BOOLEAN_VALUE, | |
shape: null, | |
size: USE_ATTRIBUTE | POSITIVE_NUMERIC_VALUE, | |
sizes: USE_ATTRIBUTE | SPACE_SEPARATED, | |
/* https://html.spec.whatwg.org/#attr-slot */ | |
slot: null, | |
sortable: BOOLEAN_VALUE, | |
sorted: SPACE_SEPARATED, | |
span: POSITIVE_NUMERIC_VALUE, | |
spellCheck: null, | |
src: null, | |
srcDoc: USE_PROPERTY, | |
srcLang: null, | |
srcSet: USE_ATTRIBUTE | COMMA_SEPARATED, | |
start: NUMERIC_VALUE, | |
step: null, | |
style: null, | |
summary: null, | |
tabIndex: NUMERIC_VALUE, | |
target: null, | |
title: null, | |
translate: null, | |
type: null, | |
typeMustMatch: BOOLEAN_VALUE, | |
useMap: null, | |
value: USE_PROPERTY, | |
volume: POSITIVE_NUMERIC_VALUE, | |
width: USE_ATTRIBUTE | NUMERIC_VALUE, | |
wmode: USE_ATTRIBUTE, | |
wrap: null, | |
/* Non-standard Properties. */ | |
/* `autoCapitalize` and `autoCorrect` are supported in | |
* Mobile Safari for keyboard hints. */ | |
autoCapitalize: null, | |
autoCorrect: null, | |
/* `autoSave` allows WebKit/Blink to persist values of | |
* input fields on page reloads */ | |
autoSave: null, | |
/* `itemProp`, `itemScope`, `itemType` are for Microdata | |
* support. See http://schema.org/docs/gs.html */ | |
itemProp: USE_ATTRIBUTE | SPACE_SEPARATED, | |
itemScope: USE_ATTRIBUTE | BOOLEAN_VALUE, | |
itemType: USE_ATTRIBUTE | SPACE_SEPARATED, | |
/* `itemID` and `itemRef` are for Microdata support as well | |
* but only specified in the the WHATWG spec document. | |
* See https://html.spec.whatwg.org/multipage/ | |
* microdata.html#microdata-dom-api */ | |
itemID: USE_ATTRIBUTE, | |
itemRef: USE_ATTRIBUTE | SPACE_SEPARATED, | |
/* `property` is supported for OpenGraph in meta tags. */ | |
property: null, | |
/* `results` show looking glass icon and recent searches | |
* on input search fields in WebKit/Blink */ | |
results: null, | |
/* IE-only attribute that specifies security | |
* restrictions on an iframe as an alternative to the | |
* sandbox attribute on IE < 10 */ | |
security: USE_ATTRIBUTE, | |
/* IE-only attribute that controls focus behavior */ | |
unselectable: USE_ATTRIBUTE, | |
/* Ancient. */ | |
xmlLang: USE_ATTRIBUTE, | |
xmlBase: USE_ATTRIBUTE | |
}; | |
/* Map of properties to attributes. | |
* Names are lower-case properties. | |
* Values are HTML attributes. */ | |
var propertyToAttributeMapping = { | |
xmlbase: 'xml:base', | |
xmllang: 'xml:lang', | |
classname: 'class', | |
htmlfor: 'for', | |
httpequiv: 'http-equiv', | |
acceptcharset: 'accept-charset' | |
}; | |
/* Expand config. */ | |
var information = {}; | |
var property; | |
var name; | |
var config; | |
getPropertyInformation.all = information; | |
for (property in propertyConfig) { | |
name = lower(property); | |
name = propertyToAttributeMapping[name] || name; | |
config = propertyConfig[property]; | |
information[name] = { | |
name: name, | |
propertyName: property, | |
mustUseAttribute: check(config, USE_ATTRIBUTE), | |
mustUseProperty: check(config, USE_PROPERTY), | |
boolean: check(config, BOOLEAN_VALUE), | |
overloadedBoolean: check(config, OVERLOADED_BOOLEAN_VALUE), | |
numeric: check(config, NUMERIC_VALUE), | |
positiveNumeric: check(config, POSITIVE_NUMERIC_VALUE), | |
commaSeparated: check(config, COMMA_SEPARATED), | |
spaceSeparated: check(config, SPACE_SEPARATED) | |
}; | |
} | |
/* Get a config for a property. */ | |
function getPropertyInformation(propertyName) { | |
var insensitive = lower(propertyName); | |
return information[propertyToAttributeMapping[insensitive] || insensitive]; | |
} | |
/* Check a mask. */ | |
function check(value, bitmask) { | |
return (value & bitmask) === bitmask; | |
} | |
/* Lower-case a string. */ | |
function lower(value) { | |
return value.toLowerCase(); | |
} | |
},{}],11:[function(require,module,exports){ | |
'use strict'; | |
/* Expose. */ | |
module.exports = factory; | |
/* Factory. */ | |
function factory(file) { | |
var contents = indices(String(file)); | |
return { | |
toPosition: offsetToPositionFactory(contents), | |
toOffset: positionToOffsetFactory(contents) | |
}; | |
} | |
/* Factory to get the line and column-based `position` for | |
* `offset` in the bound indices. */ | |
function offsetToPositionFactory(indices) { | |
return offsetToPosition; | |
/* Get the line and column-based `position` for | |
* `offset` in the bound indices. */ | |
function offsetToPosition(offset) { | |
var index = -1; | |
var length = indices.length; | |
if (offset < 0) { | |
return {}; | |
} | |
while (++index < length) { | |
if (indices[index] > offset) { | |
return { | |
line: index + 1, | |
column: (offset - (indices[index - 1] || 0)) + 1, | |
offset: offset | |
}; | |
} | |
} | |
return {}; | |
} | |
} | |
/* Factory to get the `offset` for a line and column-based | |
* `position` in the bound indices. */ | |
function positionToOffsetFactory(indices) { | |
return positionToOffset; | |
/* Get the `offset` for a line and column-based | |
* `position` in the bound indices. */ | |
function positionToOffset(position) { | |
var line = position && position.line; | |
var column = position && position.column; | |
if (!isNaN(line) && !isNaN(column) && line - 1 in indices) { | |
return ((indices[line - 2] || 0) + column - 1) || 0; | |
} | |
return -1; | |
} | |
} | |
/* Get indices of line-breaks in `value`. */ | |
function indices(value) { | |
var result = []; | |
var index = value.indexOf('\n'); | |
while (index !== -1) { | |
result.push(index + 1); | |
index = value.indexOf('\n', index + 1); | |
} | |
result.push(value.length + 1); | |
return result; | |
} | |
},{}],12:[function(require,module,exports){ | |
'use strict'; | |
var xtend = require('xtend'); | |
var toH = require('hast-to-hyperscript'); | |
var NS = require('web-namespaces'); | |
var zwitch = require('zwitch'); | |
var mapz = require('mapz'); | |
module.exports = transform; | |
var own = {}.hasOwnProperty; | |
var one = zwitch('type'); | |
var all = mapz(one, {key: 'children', indices: false}); | |
var customProps = ['__location', 'childNodes', 'content', 'parentNode', 'namespaceURI']; | |
one.handlers.root = root; | |
one.handlers.element = element; | |
one.handlers.text = text; | |
one.handlers.comment = comment; | |
one.handlers.doctype = doctype; | |
/* Map of tag-names starting new namespaces. */ | |
var namespaces = { | |
math: NS.mathml, | |
svg: NS.svg | |
}; | |
/* Map of attributes with namespaces. */ | |
var attributeSpaces = { | |
'xlink:actuate': {prefix: 'xlink', name: 'actuate', namespace: NS.xlink}, | |
'xlink:arcrole': {prefix: 'xlink', name: 'arcrole', namespace: NS.xlink}, | |
'xlink:href': {prefix: 'xlink', name: 'href', namespace: NS.xlink}, | |
'xlink:role': {prefix: 'xlink', name: 'role', namespace: NS.xlink}, | |
'xlink:show': {prefix: 'xlink', name: 'show', namespace: NS.xlink}, | |
'xlink:title': {prefix: 'xlink', name: 'title', namespace: NS.xlink}, | |
'xlink:type': {prefix: 'xlink', name: 'type', namespace: NS.xlink}, | |
'xml:base': {prefix: 'xml', name: 'base', namespace: NS.xml}, | |
'xml:lang': {prefix: 'xml', name: 'lang', namespace: NS.xml}, | |
'xml:space': {prefix: 'xml', name: 'space', namespace: NS.xml}, | |
xmlns: {prefix: '', name: 'xmlns', namespace: NS.xmlns}, | |
'xmlns:xlink': {prefix: 'xmlns', name: 'xlink', namespace: NS.xmlns} | |
}; | |
/* Transform a tree from HAST to Parse5’s AST. */ | |
function transform(tree) { | |
return patch(one(tree), null, NS.html); | |
} | |
function root(node) { | |
var data = node.data || {}; | |
var qs = own.call(data, 'quirksMode') ? Boolean(data.quirksMode) : false; | |
return { | |
nodeName: '#document', | |
mode: qs ? 'quirks' : 'no-quirks', | |
childNodes: all(node) | |
}; | |
} | |
function element(node) { | |
var shallow = xtend(node); | |
shallow.children = []; | |
return toH(function (name, attrs) { | |
var values = []; | |
var content; | |
var value; | |
var key; | |
for (key in attrs) { | |
value = {name: key, value: attrs[key]}; | |
if (own.call(attributeSpaces, key)) { | |
value = xtend(value, attributeSpaces[key]); | |
} | |
values.push(value); | |
} | |
if (name === 'template') { | |
content = transform(shallow.content); | |
delete content.mode; | |
content.nodeName = '#document-fragment'; | |
} | |
return wrap(node, { | |
nodeName: node.tagName, | |
tagName: node.tagName, | |
attrs: values, | |
childNodes: node.children ? all(node) : [] | |
}, content); | |
}, shallow); | |
} | |
function doctype(node) { | |
return wrap(node, { | |
nodeName: '#documentType', | |
name: node.name, | |
publicId: node.public || null, | |
systemId: node.system || null | |
}); | |
} | |
function text(node) { | |
return wrap(node, { | |
nodeName: '#text', | |
value: node.value | |
}); | |
} | |
function comment(node) { | |
return wrap(node, { | |
nodeName: '#comment', | |
data: node.value | |
}); | |
} | |
/* Patch position. */ | |
function wrap(node, ast, content) { | |
if (node.position && node.position.start && node.position.end) { | |
ast.__location = { | |
line: node.position.start.line, | |
col: node.position.start.column, | |
startOffset: node.position.start.offset, | |
endOffset: node.position.end.offset | |
}; | |
} | |
if (content) { | |
ast.content = content; | |
} | |
return ast; | |
} | |
/* Patch a tree recursively, by adding namespaces | |
* and parent references where needed. */ | |
function patch(node, parent, ns) { | |
var location = node.__location; | |
var children = node.childNodes; | |
var name = node.tagName; | |
var replacement = {}; | |
var length; | |
var index; | |
var key; | |
for (key in node) { | |
if (customProps.indexOf(key) === -1) { | |
replacement[key] = node[key]; | |
} | |
} | |
if (own.call(namespaces, name)) { | |
ns = namespaces[name]; | |
} | |
if (own.call(replacement, 'tagName')) { | |
replacement.namespaceURI = ns; | |
} | |
if (children) { | |
replacement.childNodes = children; | |
length = children.length; | |
index = -1; | |
while (++index < length) { | |
children[index] = patch(children[index], replacement, ns); | |
} | |
} | |
if (name === 'template') { | |
replacement.content = patch(node.content, null, ns); | |
} | |
if (parent) { | |
replacement.parentNode = parent; | |
} | |
if (location) { | |
replacement.__location = location; | |
} | |
return replacement; | |
} | |
},{"hast-to-hyperscript":13,"mapz":28,"web-namespaces":47,"xtend":30,"zwitch":48}],13:[function(require,module,exports){ | |
'use strict'; | |
var trim = require('trim'); | |
var paramCase = require('kebab-case'); | |
var information = require('property-information'); | |
var spaces = require('space-separated-tokens'); | |
var commas = require('comma-separated-tokens'); | |
var nan = require('is-nan'); | |
var is = require('unist-util-is'); | |
module.exports = wrapper; | |
function wrapper(h, node, prefix) { | |
var r; | |
var v; | |
if (typeof h !== 'function') { | |
throw new Error('h is not a function'); | |
} | |
if (!is('element', node)) { | |
throw new Error('Expected element, not `' + node + '`'); | |
} | |
r = react(h); | |
v = vdom(h); | |
if (prefix === null || prefix === undefined) { | |
prefix = r === true || v === true ? 'h-' : false; | |
} | |
return toH(h, node, { | |
prefix: prefix, | |
key: 0, | |
react: r, | |
vdom: v, | |
hyperscript: hyperscript(h) | |
}); | |
} | |
/* Transform a HAST node through a hyperscript interface | |
* to *anything*! */ | |
function toH(h, node, ctx) { | |
var selector = node.tagName; | |
var properties; | |
var attributes; | |
var children; | |
var property; | |
var elements; | |
var length; | |
var index; | |
var value; | |
properties = node.properties; | |
attributes = {}; | |
for (property in properties) { | |
addAttribute(attributes, property, properties[property], ctx); | |
} | |
if (ctx.vdom === true) { | |
selector = selector.toUpperCase(); | |
} | |
if (ctx.hyperscript === true && attributes.id) { | |
selector += '#' + attributes.id; | |
delete attributes.id; | |
} | |
if ((ctx.hyperscript === true || ctx.vdom === true) && attributes.className) { | |
selector += '.' + spaces.parse(attributes.className).join('.'); | |
delete attributes.className; | |
} | |
if (typeof attributes.style === 'string') { | |
/* VDOM expects a `string` style in `attributes` | |
* See https://github.com/Matt-Esch/virtual-dom/blob/947ecf9/ | |
* docs/vnode.md#propertiesstyle-vs-propertiesattributesstyle */ | |
if (ctx.vdom === true) { | |
if (!attributes.attributes) { | |
attributes.attributes = {}; | |
} | |
attributes.attributes.style = attributes.style; | |
delete attributes.style; | |
/* React only accepts `style` as object. */ | |
} else if (ctx.react === true) { | |
attributes.style = parseStyle(attributes.style); | |
} | |
} | |
if (ctx.prefix) { | |
ctx.key++; | |
attributes.key = ctx.prefix + ctx.key; | |
} | |
elements = []; | |
children = node.children || []; | |
length = children.length; | |
index = -1; | |
while (++index < length) { | |
value = children[index]; | |
if (is('element', value)) { | |
elements.push(toH(h, value, ctx)); | |
} else if (is('text', value)) { | |
elements.push(value.value); | |
} | |
} | |
/* Ensure no React warnings are triggered for | |
* void elements having children passed in. */ | |
if (elements.length === 0) { | |
elements = undefined; | |
} | |
return h(selector, attributes, elements); | |
} | |
/* Add `name` and its `value` to `props`. */ | |
function addAttribute(props, name, value, ctx) { | |
var info = information(name) || {}; | |
var subprop; | |
/* Ignore nully, `false`, `NaN`, and falsey known | |
* booleans. */ | |
if ( | |
value === null || | |
value === undefined || | |
value === false || | |
nan(value) || | |
(info.boolean && !value) | |
) { | |
return; | |
} | |
name = info.name || paramCase(name); | |
if (value !== null && typeof value === 'object' && 'length' in value) { | |
/* Accept `array`. Most props are space-separater. */ | |
value = (info.commaSeparated ? commas : spaces).stringify(value); | |
} | |
/* Treat `true` and truthy known booleans. */ | |
if (info.boolean && ctx.hyperscript === true) { | |
value = ''; | |
} | |
if (info.name !== 'class' && (info.mustUseAttribute || !info.name)) { | |
if (ctx.vdom === true) { | |
subprop = 'attributes'; | |
} else if (ctx.hyperscript === true) { | |
subprop = 'attrs'; | |
} | |
if (subprop) { | |
if (props[subprop] === undefined) { | |
props[subprop] = {}; | |
} | |
props[subprop][name] = value; | |
return; | |
} | |
} | |
props[info.propertyName || name] = value; | |
} | |
/* Check if `h` is `react.createElement`. It doesn’t accept | |
* `class` as an attribute, it must be added through the | |
* `selector`. */ | |
function react(h) { | |
var node = h && h('div'); | |
return Boolean(node && ('_owner' in node || '_store' in node) && node.key === null); | |
} | |
/* Check if `h` is `hyperscript`. It doesn’t accept | |
* `class` as an attribute, it must be added through the | |
* `selector`. */ | |
function hyperscript(h) { | |
return Boolean(h && h.context && h.cleanup); | |
} | |
/** | |
* Check if `h` is `virtual-dom/h`. It’s the only | |
* hyperscript “compatible” interface needing `attributes`. */ | |
function vdom(h) { | |
try { | |
return h('div').type === 'VirtualNode'; | |
} catch (err) { /* Empty */ } | |
/* istanbul ignore next */ | |
return false; | |
} | |
function parseStyle(value) { | |
var result = {}; | |
var declarations = value.split(';'); | |
var length = declarations.length; | |
var index = -1; | |
var declaration; | |
var prop; | |
var pos; | |
while (++index < length) { | |
declaration = declarations[index]; | |
pos = declaration.indexOf(':'); | |
if (pos !== -1) { | |
prop = camelCase(trim(declaration.slice(0, pos))); | |
result[prop] = trim(declaration.slice(pos + 1)); | |
} | |
} | |
return result; | |
} | |
function camelCase(val) { | |
if (val.slice(0, 4) === '-ms-') { | |
val = 'ms-' + val.slice(4); | |
} | |
return val.replace(/-([a-z])/g, replace); | |
} | |
function replace($0, $1) { | |
return $1.toUpperCase(); | |
} | |
},{"comma-separated-tokens":14,"is-nan":16,"kebab-case":23,"property-information":24,"space-separated-tokens":25,"trim":26,"unist-util-is":27}],14:[function(require,module,exports){ | |
arguments[4][5][0].apply(exports,arguments) | |
},{"dup":5,"trim":26}],15:[function(require,module,exports){ | |
'use strict'; | |
/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */ | |
module.exports = function isNaN(value) { | |
return value !== value; | |
}; | |
},{}],16:[function(require,module,exports){ | |
'use strict'; | |
var define = require('define-properties'); | |
var implementation = require('./implementation'); | |
var getPolyfill = require('./polyfill'); | |
var shim = require('./shim'); | |
/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */ | |
define(implementation, { | |
getPolyfill: getPolyfill, | |
implementation: implementation, | |
shim: shim | |
}); | |
module.exports = implementation; | |
},{"./implementation":15,"./polyfill":21,"./shim":22,"define-properties":17}],17:[function(require,module,exports){ | |
'use strict'; | |
var keys = require('object-keys'); | |
var foreach = require('foreach'); | |
var hasSymbols = typeof Symbol === 'function' && typeof Symbol() === 'symbol'; | |
var toStr = Object.prototype.toString; | |
var isFunction = function (fn) { | |
return typeof fn === 'function' && toStr.call(fn) === '[object Function]'; | |
}; | |
var arePropertyDescriptorsSupported = function () { | |
var obj = {}; | |
try { | |
Object.defineProperty(obj, 'x', { enumerable: false, value: obj }); | |
/* eslint-disable no-unused-vars, no-restricted-syntax */ | |
for (var _ in obj) { return false; } | |
/* eslint-enable no-unused-vars, no-restricted-syntax */ | |
return obj.x === obj; | |
} catch (e) { /* this is IE 8. */ | |
return false; | |
} | |
}; | |
var supportsDescriptors = Object.defineProperty && arePropertyDescriptorsSupported(); | |
var defineProperty = function (object, name, value, predicate) { | |
if (name in object && (!isFunction(predicate) || !predicate())) { | |
return; | |
} | |
if (supportsDescriptors) { | |
Object.defineProperty(object, name, { | |
configurable: true, | |
enumerable: false, | |
value: value, | |
writable: true | |
}); | |
} else { | |
object[name] = value; | |
} | |
}; | |
var defineProperties = function (object, map) { | |
var predicates = arguments.length > 2 ? arguments[2] : {}; | |
var props = keys(map); | |
if (hasSymbols) { | |
props = props.concat(Object.getOwnPropertySymbols(map)); | |
} | |
foreach(props, function (name) { | |
defineProperty(object, name, map[name], predicates[name]); | |
}); | |
}; | |
defineProperties.supportsDescriptors = !!supportsDescriptors; | |
module.exports = defineProperties; | |
},{"foreach":18,"object-keys":19}],18:[function(require,module,exports){ | |
var hasOwn = Object.prototype.hasOwnProperty; | |
var toString = Object.prototype.toString; | |
module.exports = function forEach (obj, fn, ctx) { | |
if (toString.call(fn) !== '[object Function]') { | |
throw new TypeError('iterator must be a function'); | |
} | |
var l = obj.length; | |
if (l === +l) { | |
for (var i = 0; i < l; i++) { | |
fn.call(ctx, obj[i], i, obj); | |
} | |
} else { | |
for (var k in obj) { | |
if (hasOwn.call(obj, k)) { | |
fn.call(ctx, obj[k], k, obj); | |
} | |
} | |
} | |
}; | |
},{}],19:[function(require,module,exports){ | |
'use strict'; | |
// modified from https://github.com/es-shims/es5-shim | |
var has = Object.prototype.hasOwnProperty; | |
var toStr = Object.prototype.toString; | |
var slice = Array.prototype.slice; | |
var isArgs = require('./isArguments'); | |
var isEnumerable = Object.prototype.propertyIsEnumerable; | |
var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString'); | |
var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype'); | |
var dontEnums = [ | |
'toString', | |
'toLocaleString', | |
'valueOf', | |
'hasOwnProperty', | |
'isPrototypeOf', | |
'propertyIsEnumerable', | |
'constructor' | |
]; | |
var equalsConstructorPrototype = function (o) { | |
var ctor = o.constructor; | |
return ctor && ctor.prototype === o; | |
}; | |
var excludedKeys = { | |
$console: true, | |
$external: true, | |
$frame: true, | |
$frameElement: true, | |
$frames: true, | |
$innerHeight: true, | |
$innerWidth: true, | |
$outerHeight: true, | |
$outerWidth: true, | |
$pageXOffset: true, | |
$pageYOffset: true, | |
$parent: true, | |
$scrollLeft: true, | |
$scrollTop: true, | |
$scrollX: true, | |
$scrollY: true, | |
$self: true, | |
$webkitIndexedDB: true, | |
$webkitStorageInfo: true, | |
$window: true | |
}; | |
var hasAutomationEqualityBug = (function () { | |
/* global window */ | |
if (typeof window === 'undefined') { return false; } | |
for (var k in window) { | |
try { | |
if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') { | |
try { | |
equalsConstructorPrototype(window[k]); | |
} catch (e) { | |
return true; | |
} | |
} | |
} catch (e) { | |
return true; | |
} | |
} | |
return false; | |
}()); | |
var equalsConstructorPrototypeIfNotBuggy = function (o) { | |
/* global window */ | |
if (typeof window === 'undefined' || !hasAutomationEqualityBug) { | |
return equalsConstructorPrototype(o); | |
} | |
try { | |
return equalsConstructorPrototype(o); | |
} catch (e) { | |
return false; | |
} | |
}; | |
var keysShim = function keys(object) { | |
var isObject = object !== null && typeof object === 'object'; | |
var isFunction = toStr.call(object) === '[object Function]'; | |
var isArguments = isArgs(object); | |
var isString = isObject && toStr.call(object) === '[object String]'; | |
var theKeys = []; | |
if (!isObject && !isFunction && !isArguments) { | |
throw new TypeError('Object.keys called on a non-object'); | |
} | |
var skipProto = hasProtoEnumBug && isFunction; | |
if (isString && object.length > 0 && !has.call(object, 0)) { | |
for (var i = 0; i < object.length; ++i) { | |
theKeys.push(String(i)); | |
} | |
} | |
if (isArguments && object.length > 0) { | |
for (var j = 0; j < object.length; ++j) { | |
theKeys.push(String(j)); | |
} | |
} else { | |
for (var name in object) { | |
if (!(skipProto && name === 'prototype') && has.call(object, name)) { | |
theKeys.push(String(name)); | |
} | |
} | |
} | |
if (hasDontEnumBug) { | |
var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object); | |
for (var k = 0; k < dontEnums.length; ++k) { | |
if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) { | |
theKeys.push(dontEnums[k]); | |
} | |
} | |
} | |
return theKeys; | |
}; | |
keysShim.shim = function shimObjectKeys() { | |
if (Object.keys) { | |
var keysWorksWithArguments = (function () { | |
// Safari 5.0 bug | |
return (Object.keys(arguments) || '').length === 2; | |
}(1, 2)); | |
if (!keysWorksWithArguments) { | |
var originalKeys = Object.keys; | |
Object.keys = function keys(object) { | |
if (isArgs(object)) { | |
return originalKeys(slice.call(object)); | |
} else { | |
return originalKeys(object); | |
} | |
}; | |
} | |
} else { | |
Object.keys = keysShim; | |
} | |
return Object.keys || keysShim; | |
}; | |
module.exports = keysShim; | |
},{"./isArguments":20}],20:[function(require,module,exports){ | |
'use strict'; | |
var toStr = Object.prototype.toString; | |
module.exports = function isArguments(value) { | |
var str = toStr.call(value); | |
var isArgs = str === '[object Arguments]'; | |
if (!isArgs) { | |
isArgs = str !== '[object Array]' && | |
value !== null && | |
typeof value === 'object' && | |
typeof value.length === 'number' && | |
value.length >= 0 && | |
toStr.call(value.callee) === '[object Function]'; | |
} | |
return isArgs; | |
}; | |
},{}],21:[function(require,module,exports){ | |
'use strict'; | |
var implementation = require('./implementation'); | |
module.exports = function getPolyfill() { | |
if (Number.isNaN && Number.isNaN(NaN) && !Number.isNaN('a')) { | |
return Number.isNaN; | |
} | |
return implementation; | |
}; | |
},{"./implementation":15}],22:[function(require,module,exports){ | |
'use strict'; | |
var define = require('define-properties'); | |
var getPolyfill = require('./polyfill'); | |
/* http://www.ecma-international.org/ecma-262/6.0/#sec-number.isnan */ | |
module.exports = function shimNumberIsNaN() { | |
var polyfill = getPolyfill(); | |
define(Number, { isNaN: polyfill }, { isNaN: function () { return Number.isNaN !== polyfill; } }); | |
return polyfill; | |
}; | |
},{"./polyfill":21,"define-properties":17}],23:[function(require,module,exports){ | |
'use strict'; | |
var KEBAB_REGEX = /[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g; | |
var REVERSE_REGEX = /-[a-z\u00E0-\u00F6\u00F8-\u00FE]/g; | |
module.exports = exports = function kebabCase(str) { | |
return str.replace(KEBAB_REGEX, function (match) { | |
return '-' + match.toLowerCase(); | |
}); | |
}; | |
exports.reverse = function (str) { | |
return str.replace(REVERSE_REGEX, function (match) { | |
return match.slice(1).toUpperCase(); | |
}); | |
}; | |
},{}],24:[function(require,module,exports){ | |
arguments[4][10][0].apply(exports,arguments) | |
},{"dup":10}],25:[function(require,module,exports){ | |
arguments[4][8][0].apply(exports,arguments) | |
},{"dup":8,"trim":26}],26:[function(require,module,exports){ | |
arguments[4][6][0].apply(exports,arguments) | |
},{"dup":6}],27:[function(require,module,exports){ | |
'use strict'; | |
/* eslint-disable max-params */ | |
/* Expose. */ | |
module.exports = is; | |
/* Assert if `test` passes for `node`. | |
* When a `parent` node is known the `index` of node */ | |
function is(test, node, index, parent, context) { | |
var hasParent = parent !== null && parent !== undefined; | |
var hasIndex = index !== null && index !== undefined; | |
var check = convert(test); | |
if ( | |
hasIndex && | |
(typeof index !== 'number' || index < 0 || index === Infinity) | |
) { | |
throw new Error('Expected positive finite index or child node'); | |
} | |
if (hasParent && (!is(null, parent) || !parent.children)) { | |
throw new Error('Expected parent node'); | |
} | |
if (!node || !node.type || typeof node.type !== 'string') { | |
return false; | |
} | |
if (hasParent !== hasIndex) { | |
throw new Error('Expected both parent and index'); | |
} | |
return Boolean(check.call(context, node, index, parent)); | |
} | |
function convert(test) { | |
if (typeof test === 'string') { | |
return typeFactory(test); | |
} | |
if (test === null || test === undefined) { | |
return ok; | |
} | |
if (typeof test === 'object') { | |
return ('length' in test ? anyFactory : matchesFactory)(test); | |
} | |
if (typeof test === 'function') { | |
return test; | |
} | |
throw new Error('Expected function, string, or object as test'); | |
} | |
function convertAll(tests) { | |
var results = []; | |
var length = tests.length; | |
var index = -1; | |
while (++index < length) { | |
results[index] = convert(tests[index]); | |
} | |
return results; | |
} | |
/* Utility assert each property in `test` is represented | |
* in `node`, and each values are strictly equal. */ | |
function matchesFactory(test) { | |
return matches; | |
function matches(node) { | |
var key; | |
for (key in test) { | |
if (node[key] !== test[key]) { | |
return false; | |
} | |
} | |
return true; | |
} | |
} | |
function anyFactory(tests) { | |
var checks = convertAll(tests); | |
var length = checks.length; | |
return matches; | |
function matches() { | |
var index = -1; | |
while (++index < length) { | |
if (checks[index].apply(this, arguments)) { | |
return true; | |
} | |
} | |
return false; | |
} | |
} | |
/* Utility to convert a string into a function which checks | |
* a given node’s type for said string. */ | |
function typeFactory(test) { | |
return type; | |
function type(node) { | |
return Boolean(node && node.type === test); | |
} | |
} | |
/* Utility to return true. */ | |
function ok() { | |
return true; | |
} | |
},{}],28:[function(require,module,exports){ | |
'use strict'; | |
var array = require('x-is-array'); | |
module.exports = factory; | |
/* Functional map with sugar. */ | |
function factory(fn, options) { | |
var settings = options || {}; | |
var key = settings.key; | |
var indices = settings.indices; | |
var gapless = settings.gapless; | |
if (typeof settings === 'string') { | |
key = settings; | |
} | |
if (indices == null) { | |
indices = true; | |
} | |
return all; | |
function all(values) { | |
var results = []; | |
var parent = values; | |
var index = -1; | |
var length; | |
var result; | |
if (key) { | |
if (array(values)) { | |
parent = null; | |
} else { | |
values = parent[key]; | |
} | |
} | |
length = values.length; | |
while (++index < length) { | |
if (indices) { | |
result = fn.call(this, values[index], index, parent); | |
} else { | |
result = fn.call(this, values[index], parent); | |
} | |
if (!gapless || result != null) { | |
results.push(result); | |
} | |
} | |
return results; | |
} | |
} | |
},{"x-is-array":29}],29:[function(require,module,exports){ | |
var nativeIsArray = Array.isArray | |
var toString = Object.prototype.toString | |
module.exports = nativeIsArray || isArray | |
function isArray(obj) { | |
return toString.call(obj) === "[object Array]" | |
} | |
},{}],30:[function(require,module,exports){ | |
module.exports = extend | |
var hasOwnProperty = Object.prototype.hasOwnProperty; | |
function extend() { | |
var target = {} | |
for (var i = 0; i < arguments.length; i++) { | |
var source = arguments[i] | |
for (var key in source) { | |
if (hasOwnProperty.call(source, key)) { | |
target[key] = source[key] | |
} | |
} | |
} | |
return target | |
} | |
},{}],31:[function(require,module,exports){ | |
module.exports=[ | |
"area", | |
"base", | |
"basefont", | |
"bgsound", | |
"br", | |
"col", | |
"command", | |
"embed", | |
"frame", | |
"hr", | |
"image", | |
"img", | |
"input", | |
"isindex", | |
"keygen", | |
"link", | |
"menuitem", | |
"meta", | |
"nextid", | |
"param", | |
"source", | |
"track", | |
"wbr" | |
] | |
},{}],32:[function(require,module,exports){ | |
'use strict'; | |
var DOCUMENT_MODE = require('./html').DOCUMENT_MODE; | |
//Const | |
var VALID_DOCTYPE_NAME = 'html', | |
QUIRKS_MODE_SYSTEM_ID = 'http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd', | |
QUIRKS_MODE_PUBLIC_ID_PREFIXES = [ | |
'+//silmaril//dtd html pro v0r11 19970101//en', | |
'-//advasoft ltd//dtd html 3.0 aswedit + extensions//en', | |
'-//as//dtd html 3.0 aswedit + extensions//en', | |
'-//ietf//dtd html 2.0 level 1//en', | |
'-//ietf//dtd html 2.0 level 2//en', | |
'-//ietf//dtd html 2.0 strict level 1//en', | |
'-//ietf//dtd html 2.0 strict level 2//en', | |
'-//ietf//dtd html 2.0 strict//en', | |
'-//ietf//dtd html 2.0//en', | |
'-//ietf//dtd html 2.1e//en', | |
'-//ietf//dtd html 3.0//en', | |
'-//ietf//dtd html 3.0//en//', | |
'-//ietf//dtd html 3.2 final//en', | |
'-//ietf//dtd html 3.2//en', | |
'-//ietf//dtd html 3//en', | |
'-//ietf//dtd html level 0//en', | |
'-//ietf//dtd html level 0//en//2.0', | |
'-//ietf//dtd html level 1//en', | |
'-//ietf//dtd html level 1//en//2.0', | |
'-//ietf//dtd html level 2//en', | |
'-//ietf//dtd html level 2//en//2.0', | |
'-//ietf//dtd html level 3//en', | |
'-//ietf//dtd html level 3//en//3.0', | |
'-//ietf//dtd html strict level 0//en', | |
'-//ietf//dtd html strict level 0//en//2.0', | |
'-//ietf//dtd html strict level 1//en', | |
'-//ietf//dtd html strict level 1//en//2.0', | |
'-//ietf//dtd html strict level 2//en', | |
'-//ietf//dtd html strict level 2//en//2.0', | |
'-//ietf//dtd html strict level 3//en', | |
'-//ietf//dtd html strict level 3//en//3.0', | |
'-//ietf//dtd html strict//en', | |
'-//ietf//dtd html strict//en//2.0', | |
'-//ietf//dtd html strict//en//3.0', | |
'-//ietf//dtd html//en', | |
'-//ietf//dtd html//en//2.0', | |
'-//ietf//dtd html//en//3.0', | |
'-//metrius//dtd metrius presentational//en', | |
'-//microsoft//dtd internet explorer 2.0 html strict//en', | |
'-//microsoft//dtd internet explorer 2.0 html//en', | |
'-//microsoft//dtd internet explorer 2.0 tables//en', | |
'-//microsoft//dtd internet explorer 3.0 html strict//en', | |
'-//microsoft//dtd internet explorer 3.0 html//en', | |
'-//microsoft//dtd internet explorer 3.0 tables//en', | |
'-//netscape comm. corp.//dtd html//en', | |
'-//netscape comm. corp.//dtd strict html//en', | |
'-//o\'reilly and associates//dtd html 2.0//en', | |
'-//o\'reilly and associates//dtd html extended 1.0//en', | |
'-//spyglass//dtd html 2.0 extended//en', | |
'-//sq//dtd html 2.0 hotmetal + extensions//en', | |
'-//sun microsystems corp.//dtd hotjava html//en', | |
'-//sun microsystems corp.//dtd hotjava strict html//en', | |
'-//w3c//dtd html 3 1995-03-24//en', | |
'-//w3c//dtd html 3.2 draft//en', | |
'-//w3c//dtd html 3.2 final//en', | |
'-//w3c//dtd html 3.2//en', | |
'-//w3c//dtd html 3.2s draft//en', | |
'-//w3c//dtd html 4.0 frameset//en', | |
'-//w3c//dtd html 4.0 transitional//en', | |
'-//w3c//dtd html experimental 19960712//en', | |
'-//w3c//dtd html experimental 970421//en', | |
'-//w3c//dtd w3 html//en', | |
'-//w3o//dtd w3 html 3.0//en', | |
'-//w3o//dtd w3 html 3.0//en//', | |
'-//webtechs//dtd mozilla html 2.0//en', | |
'-//webtechs//dtd mozilla html//en' | |
], | |
QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES = QUIRKS_MODE_PUBLIC_ID_PREFIXES.concat([ | |
'-//w3c//dtd html 4.01 frameset//', | |
'-//w3c//dtd html 4.01 transitional//' | |
]), | |
QUIRKS_MODE_PUBLIC_IDS = [ | |
'-//w3o//dtd w3 html strict 3.0//en//', | |
'-/w3c/dtd html 4.0 transitional/en', | |
'html' | |
], | |
LIMITED_QUIRKS_PUBLIC_ID_PREFIXES = [ | |
'-//W3C//DTD XHTML 1.0 Frameset//', | |
'-//W3C//DTD XHTML 1.0 Transitional//' | |
], | |
LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES = LIMITED_QUIRKS_PUBLIC_ID_PREFIXES.concat([ | |
'-//W3C//DTD HTML 4.01 Frameset//', | |
'-//W3C//DTD HTML 4.01 Transitional//' | |
]); | |
//Utils | |
function enquoteDoctypeId(id) { | |
var quote = id.indexOf('"') !== -1 ? '\'' : '"'; | |
return quote + id + quote; | |
} | |
function hasPrefix(publicId, prefixes) { | |
for (var i = 0; i < prefixes.length; i++) { | |
if (publicId.indexOf(prefixes[i]) === 0) | |
return true; | |
} | |
return false; | |
} | |
//API | |
exports.getDocumentMode = function (name, publicId, systemId) { | |
if (name !== VALID_DOCTYPE_NAME) | |
return DOCUMENT_MODE.QUIRKS; | |
if (systemId && systemId.toLowerCase() === QUIRKS_MODE_SYSTEM_ID) | |
return DOCUMENT_MODE.QUIRKS; | |
if (publicId !== null) { | |
publicId = publicId.toLowerCase(); | |
if (QUIRKS_MODE_PUBLIC_IDS.indexOf(publicId) > -1) | |
return DOCUMENT_MODE.QUIRKS; | |
var prefixes = systemId === null ? QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES : QUIRKS_MODE_PUBLIC_ID_PREFIXES; | |
if (hasPrefix(publicId, prefixes)) | |
return DOCUMENT_MODE.QUIRKS; | |
prefixes = systemId === null ? LIMITED_QUIRKS_PUBLIC_ID_PREFIXES : LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES; | |
if (hasPrefix(publicId, prefixes)) | |
return DOCUMENT_MODE.LIMITED_QUIRKS; | |
} | |
return DOCUMENT_MODE.NO_QUIRKS; | |
}; | |
exports.serializeContent = function (name, publicId, systemId) { | |
var str = '!DOCTYPE '; | |
if (name) | |
str += name; | |
if (publicId !== null) | |
str += ' PUBLIC ' + enquoteDoctypeId(publicId); | |
else if (systemId !== null) | |
str += ' SYSTEM'; | |
if (systemId !== null) | |
str += ' ' + enquoteDoctypeId(systemId); | |
return str; | |
}; | |
},{"./html":34}],33:[function(require,module,exports){ | |
'use strict'; | |
var Tokenizer = require('../tokenizer'), | |
HTML = require('./html'); | |
//Aliases | |
var $ = HTML.TAG_NAMES, | |
NS = HTML.NAMESPACES, | |
ATTRS = HTML.ATTRS; | |
//MIME types | |
var MIME_TYPES = { | |
TEXT_HTML: 'text/html', | |
APPLICATION_XML: 'application/xhtml+xml' | |
}; | |
//Attributes | |
var DEFINITION_URL_ATTR = 'definitionurl', | |
ADJUSTED_DEFINITION_URL_ATTR = 'definitionURL', | |
SVG_ATTRS_ADJUSTMENT_MAP = { | |
'attributename': 'attributeName', | |
'attributetype': 'attributeType', | |
'basefrequency': 'baseFrequency', | |
'baseprofile': 'baseProfile', | |
'calcmode': 'calcMode', | |
'clippathunits': 'clipPathUnits', | |
'diffuseconstant': 'diffuseConstant', | |
'edgemode': 'edgeMode', | |
'filterunits': 'filterUnits', | |
'glyphref': 'glyphRef', | |
'gradienttransform': 'gradientTransform', | |
'gradientunits': 'gradientUnits', | |
'kernelmatrix': 'kernelMatrix', | |
'kernelunitlength': 'kernelUnitLength', | |
'keypoints': 'keyPoints', | |
'keysplines': 'keySplines', | |
'keytimes': 'keyTimes', | |
'lengthadjust': 'lengthAdjust', | |
'limitingconeangle': 'limitingConeAngle', | |
'markerheight': 'markerHeight', | |
'markerunits': 'markerUnits', | |
'markerwidth': 'markerWidth', | |
'maskcontentunits': 'maskContentUnits', | |
'maskunits': 'maskUnits', | |
'numoctaves': 'numOctaves', | |
'pathlength': 'pathLength', | |
'patterncontentunits': 'patternContentUnits', | |
'patterntransform': 'patternTransform', | |
'patternunits': 'patternUnits', | |
'pointsatx': 'pointsAtX', | |
'pointsaty': 'pointsAtY', | |
'pointsatz': 'pointsAtZ', | |
'preservealpha': 'preserveAlpha', | |
'preserveaspectratio': 'preserveAspectRatio', | |
'primitiveunits': 'primitiveUnits', | |
'refx': 'refX', | |
'refy': 'refY', | |
'repeatcount': 'repeatCount', | |
'repeatdur': 'repeatDur', | |
'requiredextensions': 'requiredExtensions', | |
'requiredfeatures': 'requiredFeatures', | |
'specularconstant': 'specularConstant', | |
'specularexponent': 'specularExponent', | |
'spreadmethod': 'spreadMethod', | |
'startoffset': 'startOffset', | |
'stddeviation': 'stdDeviation', | |
'stitchtiles': 'stitchTiles', | |
'surfacescale': 'surfaceScale', | |
'systemlanguage': 'systemLanguage', | |
'tablevalues': 'tableValues', | |
'targetx': 'targetX', | |
'targety': 'targetY', | |
'textlength': 'textLength', | |
'viewbox': 'viewBox', | |
'viewtarget': 'viewTarget', | |
'xchannelselector': 'xChannelSelector', | |
'ychannelselector': 'yChannelSelector', | |
'zoomandpan': 'zoomAndPan' | |
}, | |
XML_ATTRS_ADJUSTMENT_MAP = { | |
'xlink:actuate': {prefix: 'xlink', name: 'actuate', namespace: NS.XLINK}, | |
'xlink:arcrole': {prefix: 'xlink', name: 'arcrole', namespace: NS.XLINK}, | |
'xlink:href': {prefix: 'xlink', name: 'href', namespace: NS.XLINK}, | |
'xlink:role': {prefix: 'xlink', name: 'role', namespace: NS.XLINK}, | |
'xlink:show': {prefix: 'xlink', name: 'show', namespace: NS.XLINK}, | |
'xlink:title': {prefix: 'xlink', name: 'title', namespace: NS.XLINK}, | |
'xlink:type': {prefix: 'xlink', name: 'type', namespace: NS.XLINK}, | |
'xml:base': {prefix: 'xml', name: 'base', namespace: NS.XML}, | |
'xml:lang': {prefix: 'xml', name: 'lang', namespace: NS.XML}, | |
'xml:space': {prefix: 'xml', name: 'space', namespace: NS.XML}, | |
'xmlns': {prefix: '', name: 'xmlns', namespace: NS.XMLNS}, | |
'xmlns:xlink': {prefix: 'xmlns', name: 'xlink', namespace: NS.XMLNS} | |
}; | |
//SVG tag names adjustment map | |
var SVG_TAG_NAMES_ADJUSTMENT_MAP = exports.SVG_TAG_NAMES_ADJUSTMENT_MAP = { | |
'altglyph': 'altGlyph', | |
'altglyphdef': 'altGlyphDef', | |
'altglyphitem': 'altGlyphItem', | |
'animatecolor': 'animateColor', | |
'animatemotion': 'animateMotion', | |
'animatetransform': 'animateTransform', | |
'clippath': 'clipPath', | |
'feblend': 'feBlend', | |
'fecolormatrix': 'feColorMatrix', | |
'fecomponenttransfer': 'feComponentTransfer', | |
'fecomposite': 'feComposite', | |
'feconvolvematrix': 'feConvolveMatrix', | |
'fediffuselighting': 'feDiffuseLighting', | |
'fedisplacementmap': 'feDisplacementMap', | |
'fedistantlight': 'feDistantLight', | |
'feflood': 'feFlood', | |
'fefunca': 'feFuncA', | |
'fefuncb': 'feFuncB', | |
'fefuncg': 'feFuncG', | |
'fefuncr': 'feFuncR', | |
'fegaussianblur': 'feGaussianBlur', | |
'feimage': 'feImage', | |
'femerge': 'feMerge', | |
'femergenode': 'feMergeNode', | |
'femorphology': 'feMorphology', | |
'feoffset': 'feOffset', | |
'fepointlight': 'fePointLight', | |
'fespecularlighting': 'feSpecularLighting', | |
'fespotlight': 'feSpotLight', | |
'fetile': 'feTile', | |
'feturbulence': 'feTurbulence', | |
'foreignobject': 'foreignObject', | |
'glyphref': 'glyphRef', | |
'lineargradient': 'linearGradient', | |
'radialgradient': 'radialGradient', | |
'textpath': 'textPath' | |
}; | |
//Tags that causes exit from foreign content | |
var EXITS_FOREIGN_CONTENT = Object.create(null); | |
EXITS_FOREIGN_CONTENT[$.B] = true; | |
EXITS_FOREIGN_CONTENT[$.BIG] = true; | |
EXITS_FOREIGN_CONTENT[$.BLOCKQUOTE] = true; | |
EXITS_FOREIGN_CONTENT[$.BODY] = true; | |
EXITS_FOREIGN_CONTENT[$.BR] = true; | |
EXITS_FOREIGN_CONTENT[$.CENTER] = true; | |
EXITS_FOREIGN_CONTENT[$.CODE] = true; | |
EXITS_FOREIGN_CONTENT[$.DD] = true; | |
EXITS_FOREIGN_CONTENT[$.DIV] = true; | |
EXITS_FOREIGN_CONTENT[$.DL] = true; | |
EXITS_FOREIGN_CONTENT[$.DT] = true; | |
EXITS_FOREIGN_CONTENT[$.EM] = true; | |
EXITS_FOREIGN_CONTENT[$.EMBED] = true; | |
EXITS_FOREIGN_CONTENT[$.H1] = true; | |
EXITS_FOREIGN_CONTENT[$.H2] = true; | |
EXITS_FOREIGN_CONTENT[$.H3] = true; | |
EXITS_FOREIGN_CONTENT[$.H4] = true; | |
EXITS_FOREIGN_CONTENT[$.H5] = true; | |
EXITS_FOREIGN_CONTENT[$.H6] = true; | |
EXITS_FOREIGN_CONTENT[$.HEAD] = true; | |
EXITS_FOREIGN_CONTENT[$.HR] = true; | |
EXITS_FOREIGN_CONTENT[$.I] = true; | |
EXITS_FOREIGN_CONTENT[$.IMG] = true; | |
EXITS_FOREIGN_CONTENT[$.LI] = true; | |
EXITS_FOREIGN_CONTENT[$.LISTING] = true; | |
EXITS_FOREIGN_CONTENT[$.MENU] = true; | |
EXITS_FOREIGN_CONTENT[$.META] = true; | |
EXITS_FOREIGN_CONTENT[$.NOBR] = true; | |
EXITS_FOREIGN_CONTENT[$.OL] = true; | |
EXITS_FOREIGN_CONTENT[$.P] = true; | |
EXITS_FOREIGN_CONTENT[$.PRE] = true; | |
EXITS_FOREIGN_CONTENT[$.RUBY] = true; | |
EXITS_FOREIGN_CONTENT[$.S] = true; | |
EXITS_FOREIGN_CONTENT[$.SMALL] = true; | |
EXITS_FOREIGN_CONTENT[$.SPAN] = true; | |
EXITS_FOREIGN_CONTENT[$.STRONG] = true; | |
EXITS_FOREIGN_CONTENT[$.STRIKE] = true; | |
EXITS_FOREIGN_CONTENT[$.SUB] = true; | |
EXITS_FOREIGN_CONTENT[$.SUP] = true; | |
EXITS_FOREIGN_CONTENT[$.TABLE] = true; | |
EXITS_FOREIGN_CONTENT[$.TT] = true; | |
EXITS_FOREIGN_CONTENT[$.U] = true; | |
EXITS_FOREIGN_CONTENT[$.UL] = true; | |
EXITS_FOREIGN_CONTENT[$.VAR] = true; | |
//Check exit from foreign content | |
exports.causesExit = function (startTagToken) { | |
var tn = startTagToken.tagName; | |
var isFontWithAttrs = tn === $.FONT && (Tokenizer.getTokenAttr(startTagToken, ATTRS.COLOR) !== null || | |
Tokenizer.getTokenAttr(startTagToken, ATTRS.SIZE) !== null || | |
Tokenizer.getTokenAttr(startTagToken, ATTRS.FACE) !== null); | |
return isFontWithAttrs ? true : EXITS_FOREIGN_CONTENT[tn]; | |
}; | |
//Token adjustments | |
exports.adjustTokenMathMLAttrs = function (token) { | |
for (var i = 0; i < token.attrs.length; i++) { | |
if (token.attrs[i].name === DEFINITION_URL_ATTR) { | |
token.attrs[i].name = ADJUSTED_DEFINITION_URL_ATTR; | |
break; | |
} | |
} | |
}; | |
exports.adjustTokenSVGAttrs = function (token) { | |
for (var i = 0; i < token.attrs.length; i++) { | |
var adjustedAttrName = SVG_ATTRS_ADJUSTMENT_MAP[token.attrs[i].name]; | |
if (adjustedAttrName) | |
token.attrs[i].name = adjustedAttrName; | |
} | |
}; | |
exports.adjustTokenXMLAttrs = function (token) { | |
for (var i = 0; i < token.attrs.length; i++) { | |
var adjustedAttrEntry = XML_ATTRS_ADJUSTMENT_MAP[token.attrs[i].name]; | |
if (adjustedAttrEntry) { | |
token.attrs[i].prefix = adjustedAttrEntry.prefix; | |
token.attrs[i].name = adjustedAttrEntry.name; | |
token.attrs[i].namespace = adjustedAttrEntry.namespace; | |
} | |
} | |
}; | |
exports.adjustTokenSVGTagName = function (token) { | |
var adjustedTagName = SVG_TAG_NAMES_ADJUSTMENT_MAP[token.tagName]; | |
if (adjustedTagName) | |
token.tagName = adjustedTagName; | |
}; | |
//Integration points | |
function isMathMLTextIntegrationPoint(tn, ns) { | |
return ns === NS.MATHML && (tn === $.MI || tn === $.MO || tn === $.MN || tn === $.MS || tn === $.MTEXT); | |
} | |
function isHtmlIntegrationPoint(tn, ns, attrs) { | |
if (ns === NS.MATHML && tn === $.ANNOTATION_XML) { | |
for (var i = 0; i < attrs.length; i++) { | |
if (attrs[i].name === ATTRS.ENCODING) { | |
var value = attrs[i].value.toLowerCase(); | |
return value === MIME_TYPES.TEXT_HTML || value === MIME_TYPES.APPLICATION_XML; | |
} | |
} | |
} | |
return ns === NS.SVG && (tn === $.FOREIGN_OBJECT || tn === $.DESC || tn === $.TITLE); | |
} | |
exports.isIntegrationPoint = function (tn, ns, attrs, foreignNS) { | |
if ((!foreignNS || foreignNS === NS.HTML) && isHtmlIntegrationPoint(tn, ns, attrs)) | |
return true; | |
if ((!foreignNS || foreignNS === NS.MATHML) && isMathMLTextIntegrationPoint(tn, ns)) | |
return true; | |
return false; | |
}; | |
},{"../tokenizer":42,"./html":34}],34:[function(require,module,exports){ | |
'use strict'; | |
var NS = exports.NAMESPACES = { | |
HTML: 'http://www.w3.org/1999/xhtml', | |
MATHML: 'http://www.w3.org/1998/Math/MathML', | |
SVG: 'http://www.w3.org/2000/svg', | |
XLINK: 'http://www.w3.org/1999/xlink', | |
XML: 'http://www.w3.org/XML/1998/namespace', | |
XMLNS: 'http://www.w3.org/2000/xmlns/' | |
}; | |
exports.ATTRS = { | |
TYPE: 'type', | |
ACTION: 'action', | |
ENCODING: 'encoding', | |
PROMPT: 'prompt', | |
NAME: 'name', | |
COLOR: 'color', | |
FACE: 'face', | |
SIZE: 'size' | |
}; | |
exports.DOCUMENT_MODE = { | |
NO_QUIRKS: 'no-quirks', | |
QUIRKS: 'quirks', | |
LIMITED_QUIRKS: 'limited-quirks' | |
}; | |
var $ = exports.TAG_NAMES = { | |
A: 'a', | |
ADDRESS: 'address', | |
ANNOTATION_XML: 'annotation-xml', | |
APPLET: 'applet', | |
AREA: 'area', | |
ARTICLE: 'article', | |
ASIDE: 'aside', | |
B: 'b', | |
BASE: 'base', | |
BASEFONT: 'basefont', | |
BGSOUND: 'bgsound', | |
BIG: 'big', | |
BLOCKQUOTE: 'blockquote', | |
BODY: 'body', | |
BR: 'br', | |
BUTTON: 'button', | |
CAPTION: 'caption', | |
CENTER: 'center', | |
CODE: 'code', | |
COL: 'col', | |
COLGROUP: 'colgroup', | |
DD: 'dd', | |
DESC: 'desc', | |
DETAILS: 'details', | |
DIALOG: 'dialog', | |
DIR: 'dir', | |
DIV: 'div', | |
DL: 'dl', | |
DT: 'dt', | |
EM: 'em', | |
EMBED: 'embed', | |
FIELDSET: 'fieldset', | |
FIGCAPTION: 'figcaption', | |
FIGURE: 'figure', | |
FONT: 'font', | |
FOOTER: 'footer', | |
FOREIGN_OBJECT: 'foreignObject', | |
FORM: 'form', | |
FRAME: 'frame', | |
FRAMESET: 'frameset', | |
H1: 'h1', | |
H2: 'h2', | |
H3: 'h3', | |
H4: 'h4', | |
H5: 'h5', | |
H6: 'h6', | |
HEAD: 'head', | |
HEADER: 'header', | |
HGROUP: 'hgroup', | |
HR: 'hr', | |
HTML: 'html', | |
I: 'i', | |
IMG: 'img', | |
IMAGE: 'image', | |
INPUT: 'input', | |
IFRAME: 'iframe', | |
KEYGEN: 'keygen', | |
LABEL: 'label', | |
LI: 'li', | |
LINK: 'link', | |
LISTING: 'listing', | |
MAIN: 'main', | |
MALIGNMARK: 'malignmark', | |
MARQUEE: 'marquee', | |
MATH: 'math', | |
MENU: 'menu', | |
MENUITEM: 'menuitem', | |
META: 'meta', | |
MGLYPH: 'mglyph', | |
MI: 'mi', | |
MO: 'mo', | |
MN: 'mn', | |
MS: 'ms', | |
MTEXT: 'mtext', | |
NAV: 'nav', | |
NOBR: 'nobr', | |
NOFRAMES: 'noframes', | |
NOEMBED: 'noembed', | |
NOSCRIPT: 'noscript', | |
OBJECT: 'object', | |
OL: 'ol', | |
OPTGROUP: 'optgroup', | |
OPTION: 'option', | |
P: 'p', | |
PARAM: 'param', | |
PLAINTEXT: 'plaintext', | |
PRE: 'pre', | |
RB: 'rb', | |
RP: 'rp', | |
RT: 'rt', | |
RTC: 'rtc', | |
RUBY: 'ruby', | |
S: 's', | |
SCRIPT: 'script', | |
SECTION: 'section', | |
SELECT: 'select', | |
SOURCE: 'source', | |
SMALL: 'small', | |
SPAN: 'span', | |
STRIKE: 'strike', | |
STRONG: 'strong', | |
STYLE: 'style', | |
SUB: 'sub', | |
SUMMARY: 'summary', | |
SUP: 'sup', | |
TABLE: 'table', | |
TBODY: 'tbody', | |
TEMPLATE: 'template', | |
TEXTAREA: 'textarea', | |
TFOOT: 'tfoot', | |
TD: 'td', | |
TH: 'th', | |
THEAD: 'thead', | |
TITLE: 'title', | |
TR: 'tr', | |
TRACK: 'track', | |
TT: 'tt', | |
U: 'u', | |
UL: 'ul', | |
SVG: 'svg', | |
VAR: 'var', | |
WBR: 'wbr', | |
XMP: 'xmp' | |
}; | |
var SPECIAL_ELEMENTS = exports.SPECIAL_ELEMENTS = Object.create(null); | |
SPECIAL_ELEMENTS[NS.HTML] = Object.create(null); | |
SPECIAL_ELEMENTS[NS.HTML][$.ADDRESS] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.APPLET] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.AREA] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.ARTICLE] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.ASIDE] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.BASE] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.BASEFONT] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.BGSOUND] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.BLOCKQUOTE] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.BODY] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.BR] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.BUTTON] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.CAPTION] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.CENTER] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.COL] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.COLGROUP] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.DD] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.DETAILS] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.DIR] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.DIV] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.DL] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.DT] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.EMBED] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.FIELDSET] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.FIGCAPTION] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.FIGURE] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.FOOTER] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.FORM] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.FRAME] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.FRAMESET] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.H1] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.H2] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.H3] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.H4] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.H5] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.H6] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.HEAD] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.HEADER] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.HGROUP] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.HR] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.HTML] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.IFRAME] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.IMG] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.INPUT] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.LI] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.LINK] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.LISTING] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.MAIN] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.MARQUEE] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.MENU] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.META] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.NAV] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.NOEMBED] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.NOFRAMES] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.NOSCRIPT] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.OBJECT] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.OL] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.P] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.PARAM] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.PLAINTEXT] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.PRE] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.SCRIPT] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.SECTION] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.SELECT] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.SOURCE] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.STYLE] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.SUMMARY] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.TABLE] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.TBODY] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.TD] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.TEMPLATE] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.TEXTAREA] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.TFOOT] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.TH] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.THEAD] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.TITLE] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.TR] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.TRACK] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.UL] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.WBR] = true; | |
SPECIAL_ELEMENTS[NS.HTML][$.XMP] = true; | |
SPECIAL_ELEMENTS[NS.MATHML] = Object.create(null); | |
SPECIAL_ELEMENTS[NS.MATHML][$.MI] = true; | |
SPECIAL_ELEMENTS[NS.MATHML][$.MO] = true; | |
SPECIAL_ELEMENTS[NS.MATHML][$.MN] = true; | |
SPECIAL_ELEMENTS[NS.MATHML][$.MS] = true; | |
SPECIAL_ELEMENTS[NS.MATHML][$.MTEXT] = true; | |
SPECIAL_ELEMENTS[NS.MATHML][$.ANNOTATION_XML] = true; | |
SPECIAL_ELEMENTS[NS.SVG] = Object.create(null); | |
SPECIAL_ELEMENTS[NS.SVG][$.TITLE] = true; | |
SPECIAL_ELEMENTS[NS.SVG][$.FOREIGN_OBJECT] = true; | |
SPECIAL_ELEMENTS[NS.SVG][$.DESC] = true; | |
},{}],35:[function(require,module,exports){ | |
'use strict'; | |
module.exports = function mergeOptions(defaults, options) { | |
options = options || Object.create(null); | |
return [defaults, options].reduce(function (merged, optObj) { | |
Object.keys(optObj).forEach(function (key) { | |
merged[key] = optObj[key]; | |
}); | |
return merged; | |
}, Object.create(null)); | |
}; | |
},{}],36:[function(require,module,exports){ | |
'use strict'; | |
exports.REPLACEMENT_CHARACTER = '\uFFFD'; | |
exports.CODE_POINTS = { | |
EOF: -1, | |
NULL: 0x00, | |
TABULATION: 0x09, | |
CARRIAGE_RETURN: 0x0D, | |
LINE_FEED: 0x0A, | |
FORM_FEED: 0x0C, | |
SPACE: 0x20, | |
EXCLAMATION_MARK: 0x21, | |
QUOTATION_MARK: 0x22, | |
NUMBER_SIGN: 0x23, | |
AMPERSAND: 0x26, | |
APOSTROPHE: 0x27, | |
HYPHEN_MINUS: 0x2D, | |
SOLIDUS: 0x2F, | |
DIGIT_0: 0x30, | |
DIGIT_9: 0x39, | |
SEMICOLON: 0x3B, | |
LESS_THAN_SIGN: 0x3C, | |
EQUALS_SIGN: 0x3D, | |
GREATER_THAN_SIGN: 0x3E, | |
QUESTION_MARK: 0x3F, | |
LATIN_CAPITAL_A: 0x41, | |
LATIN_CAPITAL_F: 0x46, | |
LATIN_CAPITAL_X: 0x58, | |
LATIN_CAPITAL_Z: 0x5A, | |
GRAVE_ACCENT: 0x60, | |
LATIN_SMALL_A: 0x61, | |
LATIN_SMALL_F: 0x66, | |
LATIN_SMALL_X: 0x78, | |
LATIN_SMALL_Z: 0x7A, | |
REPLACEMENT_CHARACTER: 0xFFFD | |
}; | |
exports.CODE_POINT_SEQUENCES = { | |
DASH_DASH_STRING: [0x2D, 0x2D], //-- | |
DOCTYPE_STRING: [0x44, 0x4F, 0x43, 0x54, 0x59, 0x50, 0x45], //DOCTYPE | |
CDATA_START_STRING: [0x5B, 0x43, 0x44, 0x41, 0x54, 0x41, 0x5B], //[CDATA[ | |
CDATA_END_STRING: [0x5D, 0x5D, 0x3E], //]]> | |
SCRIPT_STRING: [0x73, 0x63, 0x72, 0x69, 0x70, 0x74], //script | |
PUBLIC_STRING: [0x50, 0x55, 0x42, 0x4C, 0x49, 0x43], //PUBLIC | |
SYSTEM_STRING: [0x53, 0x59, 0x53, 0x54, 0x45, 0x4D] //SYSTEM | |
}; | |
},{}],37:[function(require,module,exports){ | |
'use strict'; | |
var OpenElementStack = require('../parser/open_element_stack'), | |
Tokenizer = require('../tokenizer'), | |
HTML = require('../common/html'); | |
//Aliases | |
var $ = HTML.TAG_NAMES; | |
exports.assign = function (parser) { | |
//NOTE: obtain Parser proto this way to avoid module circular references | |
var parserProto = Object.getPrototypeOf(parser), | |
treeAdapter = parser.treeAdapter, | |
attachableElementLocation = null, | |
lastFosterParentingLocation = null, | |
currentToken = null; | |
function setEndLocation(element, closingToken) { | |
var loc = element.__location; | |
if (!loc) | |
return; | |
if (!loc.startTag) { | |
loc.startTag = { | |
line: loc.line, | |
col: loc.col, | |
startOffset: loc.startOffset, | |
endOffset: loc.endOffset | |
}; | |
if (loc.attrs) | |
loc.startTag.attrs = loc.attrs; | |
} | |
if (closingToken.location) { | |
var ctLocation = closingToken.location, | |
tn = treeAdapter.getTagName(element), | |
// NOTE: For cases like <p> <p> </p> - First 'p' closes without a closing tag and | |
// for cases like <td> <p> </td> - 'p' closes without a closing tag | |
isClosingEndTag = closingToken.type === Tokenizer.END_TAG_TOKEN && | |
tn === closingToken.tagName; | |
if (isClosingEndTag) { | |
loc.endTag = { | |
line: ctLocation.line, | |
col: ctLocation.col, | |
startOffset: ctLocation.startOffset, | |
endOffset: ctLocation.endOffset | |
}; | |
} | |
if (isClosingEndTag) | |
loc.endOffset = ctLocation.endOffset; | |
else | |
loc.endOffset = ctLocation.startOffset; | |
} | |
else if (closingToken.type === Tokenizer.EOF_TOKEN) | |
loc.endOffset = parser.tokenizer.preprocessor.sourcePos; | |
} | |
//NOTE: patch _bootstrap method | |
parser._bootstrap = function (document, fragmentContext) { | |
parserProto._bootstrap.call(this, document, fragmentContext); | |
attachableElementLocation = null; | |
lastFosterParentingLocation = null; | |
currentToken = null; | |
//OpenElementStack | |
parser.openElements.pop = function () { | |
setEndLocation(this.current, currentToken); | |
OpenElementStack.prototype.pop.call(this); | |
}; | |
parser.openElements.popAllUpToHtmlElement = function () { | |
for (var i = this.stackTop; i > 0; i--) | |
setEndLocation(this.items[i], currentToken); | |
OpenElementStack.prototype.popAllUpToHtmlElement.call(this); | |
}; | |
parser.openElements.remove = function (element) { | |
setEndLocation(element, currentToken); | |
OpenElementStack.prototype.remove.call(this, element); | |
}; | |
}; | |
parser._runParsingLoop = function (scriptHandler) { | |
parserProto._runParsingLoop.call(this, scriptHandler); | |
// NOTE: generate location info for elements | |
// that remains on open element stack | |
for (var i = parser.openElements.stackTop; i >= 0; i--) | |
setEndLocation(parser.openElements.items[i], currentToken); | |
}; | |
//Token processing | |
parser._processTokenInForeignContent = function (token) { | |
currentToken = token; | |
parserProto._processTokenInForeignContent.call(this, token); | |
}; | |
parser._processToken = function (token) { | |
currentToken = token; | |
parserProto._processToken.call(this, token); | |
//NOTE: <body> and <html> are never popped from the stack, so we need to updated | |
//their end location explicitly. | |
if (token.type === Tokenizer.END_TAG_TOKEN && | |
(token.tagName === $.HTML || | |
token.tagName === $.BODY && this.openElements.hasInScope($.BODY))) { | |
for (var i = this.openElements.stackTop; i >= 0; i--) { | |
var element = this.openElements.items[i]; | |
if (this.treeAdapter.getTagName(element) === token.tagName) { | |
setEndLocation(element, token); | |
break; | |
} | |
} | |
} | |
}; | |
//Doctype | |
parser._setDocumentType = function (token) { | |
parserProto._setDocumentType.call(this, token); | |
var documentChildren = this.treeAdapter.getChildNodes(this.document), | |
cnLength = documentChildren.length; | |
for (var i = 0; i < cnLength; i++) { | |
var node = documentChildren[i]; | |
if (this.treeAdapter.isDocumentTypeNode(node)) { | |
node.__location = token.location; | |
break; | |
} | |
} | |
}; | |
//Elements | |
parser._attachElementToTree = function (element) { | |
//NOTE: _attachElementToTree is called from _appendElement, _insertElement and _insertTemplate methods. | |
//So we will use token location stored in this methods for the element. | |
element.__location = attachableElementLocation || null; | |
attachableElementLocation = null; | |
parserProto._attachElementToTree.call(this, element); | |
}; | |
parser._appendElement = function (token, namespaceURI) { | |
attachableElementLocation = token.location; | |
parserProto._appendElement.call(this, token, namespaceURI); | |
}; | |
parser._insertElement = function (token, namespaceURI) { | |
attachableElementLocation = token.location; | |
parserProto._insertElement.call(this, token, namespaceURI); | |
}; | |
parser._insertTemplate = function (token) { | |
attachableElementLocation = token.location; | |
parserProto._insertTemplate.call(this, token); | |
var tmplContent = this.treeAdapter.getTemplateContent(this.openElements.current); | |
tmplContent.__location = null; | |
}; | |
parser._insertFakeRootElement = function () { | |
parserProto._insertFakeRootElement.call(this); | |
this.openElements.current.__location = null; | |
}; | |
//Comments | |
parser._appendCommentNode = function (token, parent) { | |
parserProto._appendCommentNode.call(this, token, parent); | |
var children = this.treeAdapter.getChildNodes(parent), | |
commentNode = children[children.length - 1]; | |
commentNode.__location = token.location; | |
}; | |
//Text | |
parser._findFosterParentingLocation = function () { | |
//NOTE: store last foster parenting location, so we will be able to find inserted text | |
//in case of foster parenting | |
lastFosterParentingLocation = parserProto._findFosterParentingLocation.call(this); | |
return lastFosterParentingLocation; | |
}; | |
parser._insertCharacters = function (token) { | |
parserProto._insertCharacters.call(this, token); | |
var hasFosterParent = this._shouldFosterParentOnInsertion(), | |
parent = hasFosterParent && lastFosterParentingLocation.parent || | |
this.openElements.currentTmplContent || | |
this.openElements.current, | |
siblings = this.treeAdapter.getChildNodes(parent), | |
textNodeIdx = hasFosterParent && lastFosterParentingLocation.beforeElement ? | |
siblings.indexOf(lastFosterParentingLocation.beforeElement) - 1 : | |
siblings.length - 1, | |
textNode = siblings[textNodeIdx]; | |
//NOTE: if we have location assigned by another token, then just update end position | |
if (textNode.__location) | |
textNode.__location.endOffset = token.location.endOffset; | |
else | |
textNode.__location = token.location; | |
}; | |
}; | |
},{"../common/html":34,"../parser/open_element_stack":41,"../tokenizer":42}],38:[function(require,module,exports){ | |
'use strict'; | |
var UNICODE = require('../common/unicode'); | |
//Aliases | |
var $ = UNICODE.CODE_POINTS; | |
exports.assign = function (tokenizer) { | |
//NOTE: obtain Tokenizer proto this way to avoid module circular references | |
var tokenizerProto = Object.getPrototypeOf(tokenizer), | |
tokenStartOffset = -1, | |
tokenCol = -1, | |
tokenLine = 1, | |
isEol = false, | |
lineStartPos = 0, | |
col = -1, | |
line = 1; | |
function attachLocationInfo(token) { | |
token.location = { | |
line: tokenLine, | |
col: tokenCol, | |
startOffset: tokenStartOffset, | |
endOffset: -1 | |
}; | |
} | |
//NOTE: patch consumption method to track line/col information | |
tokenizer._consume = function () { | |
var cp = tokenizerProto._consume.call(this); | |
//NOTE: LF should be in the last column of the line | |
if (isEol) { | |
isEol = false; | |
line++; | |
lineStartPos = this.preprocessor.sourcePos; | |
} | |
if (cp === $.LINE_FEED) | |
isEol = true; | |
col = this.preprocessor.sourcePos - lineStartPos + 1; | |
return cp; | |
}; | |
tokenizer._unconsume = function () { | |
tokenizerProto._unconsume.call(this); | |
isEol = false; | |
col = this.preprocessor.sourcePos - lineStartPos + 1; | |
}; | |
//NOTE: patch token creation methods and attach location objects | |
tokenizer._createStartTagToken = function () { | |
tokenizerProto._createStartTagToken.call(this); | |
attachLocationInfo(this.currentToken); | |
}; | |
tokenizer._createEndTagToken = function () { | |
tokenizerProto._createEndTagToken.call(this); | |
attachLocationInfo(this.currentToken); | |
}; | |
tokenizer._createCommentToken = function () { | |
tokenizerProto._createCommentToken.call(this); | |
attachLocationInfo(this.currentToken); | |
}; | |
tokenizer._createDoctypeToken = function (initialName) { | |
tokenizerProto._createDoctypeToken.call(this, initialName); | |
attachLocationInfo(this.currentToken); | |
}; | |
tokenizer._createCharacterToken = function (type, ch) { | |
tokenizerProto._createCharacterToken.call(this, type, ch); | |
attachLocationInfo(this.currentCharacterToken); | |
}; | |
tokenizer._createAttr = function (attrNameFirstCh) { | |
tokenizerProto._createAttr.call(this, attrNameFirstCh); | |
this.currentAttrLocation = { | |
line: line, | |
col: col, | |
startOffset: this.preprocessor.sourcePos, | |
endOffset: -1 | |
}; | |
}; | |
tokenizer._leaveAttrName = function (toState) { | |
tokenizerProto._leaveAttrName.call(this, toState); | |
this._attachCurrentAttrLocationInfo(); | |
}; | |
tokenizer._leaveAttrValue = function (toState) { | |
tokenizerProto._leaveAttrValue.call(this, toState); | |
this._attachCurrentAttrLocationInfo(); | |
}; | |
tokenizer._attachCurrentAttrLocationInfo = function () { | |
this.currentAttrLocation.endOffset = this.preprocessor.sourcePos; | |
if (!this.currentToken.location.attrs) | |
this.currentToken.location.attrs = Object.create(null); | |
this.currentToken.location.attrs[this.currentAttr.name] = this.currentAttrLocation; | |
}; | |
//NOTE: patch token emission methods to determine end location | |
tokenizer._emitCurrentToken = function () { | |
//NOTE: if we have pending character token make it's end location equal to the | |
//current token's start location. | |
if (this.currentCharacterToken) | |
this.currentCharacterToken.location.endOffset = this.currentToken.location.startOffset; | |
this.currentToken.location.endOffset = this.preprocessor.sourcePos + 1; | |
tokenizerProto._emitCurrentToken.call(this); | |
}; | |
tokenizer._emitCurrentCharacterToken = function () { | |
//NOTE: if we have character token and it's location wasn't set in the _emitCurrentToken(), | |
//then set it's location at the current preprocessor position. | |
//We don't need to increment preprocessor position, since character token | |
//emission is always forced by the start of the next character token here. | |
//So, we already have advanced position. | |
if (this.currentCharacterToken && this.currentCharacterToken.location.endOffset === -1) | |
this.currentCharacterToken.location.endOffset = this.preprocessor.sourcePos; | |
tokenizerProto._emitCurrentCharacterToken.call(this); | |
}; | |
//NOTE: patch initial states for each mode to obtain token start position | |
Object.keys(tokenizerProto.MODE) | |
.map(function (modeName) { | |
return tokenizerProto.MODE[modeName]; | |
}) | |
.forEach(function (state) { | |
tokenizer[state] = function (cp) { | |
tokenStartOffset = this.preprocessor.sourcePos; | |
tokenLine = line; | |
tokenCol = col; | |
tokenizerProto[state].call(this, cp); | |
}; | |
}); | |
}; | |
},{"../common/unicode":36}],39:[function(require,module,exports){ | |
'use strict'; | |
//Const | |
var NOAH_ARK_CAPACITY = 3; | |
//List of formatting elements | |
var FormattingElementList = module.exports = function (treeAdapter) { | |
this.length = 0; | |
this.entries = []; | |
this.treeAdapter = treeAdapter; | |
this.bookmark = null; | |
}; | |
//Entry types | |
FormattingElementList.MARKER_ENTRY = 'MARKER_ENTRY'; | |
FormattingElementList.ELEMENT_ENTRY = 'ELEMENT_ENTRY'; | |
//Noah Ark's condition | |
//OPTIMIZATION: at first we try to find possible candidates for exclusion using | |
//lightweight heuristics without thorough attributes check. | |
FormattingElementList.prototype._getNoahArkConditionCandidates = function (newElement) { | |
var candidates = []; | |
if (this.length >= NOAH_ARK_CAPACITY) { | |
var neAttrsLength = this.treeAdapter.getAttrList(newElement).length, | |
neTagName = this.treeAdapter.getTagName(newElement), | |
neNamespaceURI = this.treeAdapter.getNamespaceURI(newElement); | |
for (var i = this.length - 1; i >= 0; i--) { | |
var entry = this.entries[i]; | |
if (entry.type === FormattingElementList.MARKER_ENTRY) | |
break; | |
var element = entry.element, | |
elementAttrs = this.treeAdapter.getAttrList(element), | |
isCandidate = this.treeAdapter.getTagName(element) === neTagName && | |
this.treeAdapter.getNamespaceURI(element) === neNamespaceURI && | |
elementAttrs.length === neAttrsLength; | |
if (isCandidate) | |
candidates.push({idx: i, attrs: elementAttrs}); | |
} | |
} | |
return candidates.length < NOAH_ARK_CAPACITY ? [] : candidates; | |
}; | |
FormattingElementList.prototype._ensureNoahArkCondition = function (newElement) { | |
var candidates = this._getNoahArkConditionCandidates(newElement), | |
cLength = candidates.length; | |
if (cLength) { | |
var neAttrs = this.treeAdapter.getAttrList(newElement), | |
neAttrsLength = neAttrs.length, | |
neAttrsMap = Object.create(null); | |
//NOTE: build attrs map for the new element so we can perform fast lookups | |
for (var i = 0; i < neAttrsLength; i++) { | |
var neAttr = neAttrs[i]; | |
neAttrsMap[neAttr.name] = neAttr.value; | |
} | |
for (i = 0; i < neAttrsLength; i++) { | |
for (var j = 0; j < cLength; j++) { | |
var cAttr = candidates[j].attrs[i]; | |
if (neAttrsMap[cAttr.name] !== cAttr.value) { | |
candidates.splice(j, 1); | |
cLength--; | |
} | |
if (candidates.length < NOAH_ARK_CAPACITY) | |
return; | |
} | |
} | |
//NOTE: remove bottommost candidates until Noah's Ark condition will not be met | |
for (i = cLength - 1; i >= NOAH_ARK_CAPACITY - 1; i--) { | |
this.entries.splice(candidates[i].idx, 1); | |
this.length--; | |
} | |
} | |
}; | |
//Mutations | |
FormattingElementList.prototype.insertMarker = function () { | |
this.entries.push({type: FormattingElementList.MARKER_ENTRY}); | |
this.length++; | |
}; | |
FormattingElementList.prototype.pushElement = function (element, token) { | |
this._ensureNoahArkCondition(element); | |
this.entries.push({ | |
type: FormattingElementList.ELEMENT_ENTRY, | |
element: element, | |
token: token | |
}); | |
this.length++; | |
}; | |
FormattingElementList.prototype.insertElementAfterBookmark = function (element, token) { | |
var bookmarkIdx = this.length - 1; | |
for (; bookmarkIdx >= 0; bookmarkIdx--) { | |
if (this.entries[bookmarkIdx] === this.bookmark) | |
break; | |
} | |
this.entries.splice(bookmarkIdx + 1, 0, { | |
type: FormattingElementList.ELEMENT_ENTRY, | |
element: element, | |
token: token | |
}); | |
this.length++; | |
}; | |
FormattingElementList.prototype.removeEntry = function (entry) { | |
for (var i = this.length - 1; i >= 0; i--) { | |
if (this.entries[i] === entry) { | |
this.entries.splice(i, 1); | |
this.length--; | |
break; | |
} | |
} | |
}; | |
FormattingElementList.prototype.clearToLastMarker = function () { | |
while (this.length) { | |
var entry = this.entries.pop(); | |
this.length--; | |
if (entry.type === FormattingElementList.MARKER_ENTRY) | |
break; | |
} | |
}; | |
//Search | |
FormattingElementList.prototype.getElementEntryInScopeWithTagName = function (tagName) { | |
for (var i = this.length - 1; i >= 0; i--) { | |
var entry = this.entries[i]; | |
if (entry.type === FormattingElementList.MARKER_ENTRY) | |
return null; | |
if (this.treeAdapter.getTagName(entry.element) === tagName) | |
return entry; | |
} | |
return null; | |
}; | |
FormattingElementList.prototype.getElementEntry = function (element) { | |
for (var i = this.length - 1; i >= 0; i--) { | |
var entry = this.entries[i]; | |
if (entry.type === FormattingElementList.ELEMENT_ENTRY && entry.element === element) | |
return entry; | |
} | |
return null; | |
}; | |
},{}],40:[function(require,module,exports){ | |
'use strict'; | |
var Tokenizer = require('../tokenizer'), | |
OpenElementStack = require('./open_element_stack'), | |
FormattingElementList = require('./formatting_element_list'), | |
locationInfoMixin = require('../location_info/parser_mixin'), | |
defaultTreeAdapter = require('../tree_adapters/default'), | |
doctype = require('../common/doctype'), | |
foreignContent = require('../common/foreign_content'), | |
mergeOptions = require('../common/merge_options'), | |
UNICODE = require('../common/unicode'), | |
HTML = require('../common/html'); | |
//Aliases | |
var $ = HTML.TAG_NAMES, | |
NS = HTML.NAMESPACES, | |
ATTRS = HTML.ATTRS; | |
var DEFAULT_OPTIONS = { | |
locationInfo: false, | |
treeAdapter: defaultTreeAdapter | |
}; | |
//Misc constants | |
var HIDDEN_INPUT_TYPE = 'hidden'; | |
//Adoption agency loops iteration count | |
var AA_OUTER_LOOP_ITER = 8, | |
AA_INNER_LOOP_ITER = 3; | |
//Insertion modes | |
var INITIAL_MODE = 'INITIAL_MODE', | |
BEFORE_HTML_MODE = 'BEFORE_HTML_MODE', | |
BEFORE_HEAD_MODE = 'BEFORE_HEAD_MODE', | |
IN_HEAD_MODE = 'IN_HEAD_MODE', | |
AFTER_HEAD_MODE = 'AFTER_HEAD_MODE', | |
IN_BODY_MODE = 'IN_BODY_MODE', | |
TEXT_MODE = 'TEXT_MODE', | |
IN_TABLE_MODE = 'IN_TABLE_MODE', | |
IN_TABLE_TEXT_MODE = 'IN_TABLE_TEXT_MODE', | |
IN_CAPTION_MODE = 'IN_CAPTION_MODE', | |
IN_COLUMN_GROUP_MODE = 'IN_COLUMN_GROUP_MODE', | |
IN_TABLE_BODY_MODE = 'IN_TABLE_BODY_MODE', | |
IN_ROW_MODE = 'IN_ROW_MODE', | |
IN_CELL_MODE = 'IN_CELL_MODE', | |
IN_SELECT_MODE = 'IN_SELECT_MODE', | |
IN_SELECT_IN_TABLE_MODE = 'IN_SELECT_IN_TABLE_MODE', | |
IN_TEMPLATE_MODE = 'IN_TEMPLATE_MODE', | |
AFTER_BODY_MODE = 'AFTER_BODY_MODE', | |
IN_FRAMESET_MODE = 'IN_FRAMESET_MODE', | |
AFTER_FRAMESET_MODE = 'AFTER_FRAMESET_MODE', | |
AFTER_AFTER_BODY_MODE = 'AFTER_AFTER_BODY_MODE', | |
AFTER_AFTER_FRAMESET_MODE = 'AFTER_AFTER_FRAMESET_MODE'; | |
//Insertion mode reset map | |
var INSERTION_MODE_RESET_MAP = Object.create(null); | |
INSERTION_MODE_RESET_MAP[$.TR] = IN_ROW_MODE; | |
INSERTION_MODE_RESET_MAP[$.TBODY] = | |
INSERTION_MODE_RESET_MAP[$.THEAD] = | |
INSERTION_MODE_RESET_MAP[$.TFOOT] = IN_TABLE_BODY_MODE; | |
INSERTION_MODE_RESET_MAP[$.CAPTION] = IN_CAPTION_MODE; | |
INSERTION_MODE_RESET_MAP[$.COLGROUP] = IN_COLUMN_GROUP_MODE; | |
INSERTION_MODE_RESET_MAP[$.TABLE] = IN_TABLE_MODE; | |
INSERTION_MODE_RESET_MAP[$.BODY] = IN_BODY_MODE; | |
INSERTION_MODE_RESET_MAP[$.FRAMESET] = IN_FRAMESET_MODE; | |
//Template insertion mode switch map | |
var TEMPLATE_INSERTION_MODE_SWITCH_MAP = Object.create(null); | |
TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.CAPTION] = | |
TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.COLGROUP] = | |
TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.TBODY] = | |
TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.TFOOT] = | |
TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.THEAD] = IN_TABLE_MODE; | |
TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.COL] = IN_COLUMN_GROUP_MODE; | |
TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.TR] = IN_TABLE_BODY_MODE; | |
TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.TD] = | |
TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.TH] = IN_ROW_MODE; | |
//Token handlers map for insertion modes | |
var _ = Object.create(null); | |
_[INITIAL_MODE] = Object.create(null); | |
_[INITIAL_MODE][Tokenizer.CHARACTER_TOKEN] = | |
_[INITIAL_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenInInitialMode; | |
_[INITIAL_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = ignoreToken; | |
_[INITIAL_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; | |
_[INITIAL_MODE][Tokenizer.DOCTYPE_TOKEN] = doctypeInInitialMode; | |
_[INITIAL_MODE][Tokenizer.START_TAG_TOKEN] = | |
_[INITIAL_MODE][Tokenizer.END_TAG_TOKEN] = | |
_[INITIAL_MODE][Tokenizer.EOF_TOKEN] = tokenInInitialMode; | |
_[BEFORE_HTML_MODE] = Object.create(null); | |
_[BEFORE_HTML_MODE][Tokenizer.CHARACTER_TOKEN] = | |
_[BEFORE_HTML_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenBeforeHtml; | |
_[BEFORE_HTML_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = ignoreToken; | |
_[BEFORE_HTML_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; | |
_[BEFORE_HTML_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; | |
_[BEFORE_HTML_MODE][Tokenizer.START_TAG_TOKEN] = startTagBeforeHtml; | |
_[BEFORE_HTML_MODE][Tokenizer.END_TAG_TOKEN] = endTagBeforeHtml; | |
_[BEFORE_HTML_MODE][Tokenizer.EOF_TOKEN] = tokenBeforeHtml; | |
_[BEFORE_HEAD_MODE] = Object.create(null); | |
_[BEFORE_HEAD_MODE][Tokenizer.CHARACTER_TOKEN] = | |
_[BEFORE_HEAD_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenBeforeHead; | |
_[BEFORE_HEAD_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = ignoreToken; | |
_[BEFORE_HEAD_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; | |
_[BEFORE_HEAD_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; | |
_[BEFORE_HEAD_MODE][Tokenizer.START_TAG_TOKEN] = startTagBeforeHead; | |
_[BEFORE_HEAD_MODE][Tokenizer.END_TAG_TOKEN] = endTagBeforeHead; | |
_[BEFORE_HEAD_MODE][Tokenizer.EOF_TOKEN] = tokenBeforeHead; | |
_[IN_HEAD_MODE] = Object.create(null); | |
_[IN_HEAD_MODE][Tokenizer.CHARACTER_TOKEN] = | |
_[IN_HEAD_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenInHead; | |
_[IN_HEAD_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters; | |
_[IN_HEAD_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; | |
_[IN_HEAD_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; | |
_[IN_HEAD_MODE][Tokenizer.START_TAG_TOKEN] = startTagInHead; | |
_[IN_HEAD_MODE][Tokenizer.END_TAG_TOKEN] = endTagInHead; | |
_[IN_HEAD_MODE][Tokenizer.EOF_TOKEN] = tokenInHead; | |
_[AFTER_HEAD_MODE] = Object.create(null); | |
_[AFTER_HEAD_MODE][Tokenizer.CHARACTER_TOKEN] = | |
_[AFTER_HEAD_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenAfterHead; | |
_[AFTER_HEAD_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters; | |
_[AFTER_HEAD_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; | |
_[AFTER_HEAD_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; | |
_[AFTER_HEAD_MODE][Tokenizer.START_TAG_TOKEN] = startTagAfterHead; | |
_[AFTER_HEAD_MODE][Tokenizer.END_TAG_TOKEN] = endTagAfterHead; | |
_[AFTER_HEAD_MODE][Tokenizer.EOF_TOKEN] = tokenAfterHead; | |
_[IN_BODY_MODE] = Object.create(null); | |
_[IN_BODY_MODE][Tokenizer.CHARACTER_TOKEN] = characterInBody; | |
_[IN_BODY_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; | |
_[IN_BODY_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody; | |
_[IN_BODY_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; | |
_[IN_BODY_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; | |
_[IN_BODY_MODE][Tokenizer.START_TAG_TOKEN] = startTagInBody; | |
_[IN_BODY_MODE][Tokenizer.END_TAG_TOKEN] = endTagInBody; | |
_[IN_BODY_MODE][Tokenizer.EOF_TOKEN] = eofInBody; | |
_[TEXT_MODE] = Object.create(null); | |
_[TEXT_MODE][Tokenizer.CHARACTER_TOKEN] = | |
_[TEXT_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = | |
_[TEXT_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters; | |
_[TEXT_MODE][Tokenizer.COMMENT_TOKEN] = | |
_[TEXT_MODE][Tokenizer.DOCTYPE_TOKEN] = | |
_[TEXT_MODE][Tokenizer.START_TAG_TOKEN] = ignoreToken; | |
_[TEXT_MODE][Tokenizer.END_TAG_TOKEN] = endTagInText; | |
_[TEXT_MODE][Tokenizer.EOF_TOKEN] = eofInText; | |
_[IN_TABLE_MODE] = Object.create(null); | |
_[IN_TABLE_MODE][Tokenizer.CHARACTER_TOKEN] = | |
_[IN_TABLE_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = | |
_[IN_TABLE_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = characterInTable; | |
_[IN_TABLE_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; | |
_[IN_TABLE_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; | |
_[IN_TABLE_MODE][Tokenizer.START_TAG_TOKEN] = startTagInTable; | |
_[IN_TABLE_MODE][Tokenizer.END_TAG_TOKEN] = endTagInTable; | |
_[IN_TABLE_MODE][Tokenizer.EOF_TOKEN] = eofInBody; | |
_[IN_TABLE_TEXT_MODE] = Object.create(null); | |
_[IN_TABLE_TEXT_MODE][Tokenizer.CHARACTER_TOKEN] = characterInTableText; | |
_[IN_TABLE_TEXT_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; | |
_[IN_TABLE_TEXT_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInTableText; | |
_[IN_TABLE_TEXT_MODE][Tokenizer.COMMENT_TOKEN] = | |
_[IN_TABLE_TEXT_MODE][Tokenizer.DOCTYPE_TOKEN] = | |
_[IN_TABLE_TEXT_MODE][Tokenizer.START_TAG_TOKEN] = | |
_[IN_TABLE_TEXT_MODE][Tokenizer.END_TAG_TOKEN] = | |
_[IN_TABLE_TEXT_MODE][Tokenizer.EOF_TOKEN] = tokenInTableText; | |
_[IN_CAPTION_MODE] = Object.create(null); | |
_[IN_CAPTION_MODE][Tokenizer.CHARACTER_TOKEN] = characterInBody; | |
_[IN_CAPTION_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; | |
_[IN_CAPTION_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody; | |
_[IN_CAPTION_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; | |
_[IN_CAPTION_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; | |
_[IN_CAPTION_MODE][Tokenizer.START_TAG_TOKEN] = startTagInCaption; | |
_[IN_CAPTION_MODE][Tokenizer.END_TAG_TOKEN] = endTagInCaption; | |
_[IN_CAPTION_MODE][Tokenizer.EOF_TOKEN] = eofInBody; | |
_[IN_COLUMN_GROUP_MODE] = Object.create(null); | |
_[IN_COLUMN_GROUP_MODE][Tokenizer.CHARACTER_TOKEN] = | |
_[IN_COLUMN_GROUP_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenInColumnGroup; | |
_[IN_COLUMN_GROUP_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters; | |
_[IN_COLUMN_GROUP_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; | |
_[IN_COLUMN_GROUP_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; | |
_[IN_COLUMN_GROUP_MODE][Tokenizer.START_TAG_TOKEN] = startTagInColumnGroup; | |
_[IN_COLUMN_GROUP_MODE][Tokenizer.END_TAG_TOKEN] = endTagInColumnGroup; | |
_[IN_COLUMN_GROUP_MODE][Tokenizer.EOF_TOKEN] = eofInBody; | |
_[IN_TABLE_BODY_MODE] = Object.create(null); | |
_[IN_TABLE_BODY_MODE][Tokenizer.CHARACTER_TOKEN] = | |
_[IN_TABLE_BODY_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = | |
_[IN_TABLE_BODY_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = characterInTable; | |
_[IN_TABLE_BODY_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; | |
_[IN_TABLE_BODY_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; | |
_[IN_TABLE_BODY_MODE][Tokenizer.START_TAG_TOKEN] = startTagInTableBody; | |
_[IN_TABLE_BODY_MODE][Tokenizer.END_TAG_TOKEN] = endTagInTableBody; | |
_[IN_TABLE_BODY_MODE][Tokenizer.EOF_TOKEN] = eofInBody; | |
_[IN_ROW_MODE] = Object.create(null); | |
_[IN_ROW_MODE][Tokenizer.CHARACTER_TOKEN] = | |
_[IN_ROW_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = | |
_[IN_ROW_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = characterInTable; | |
_[IN_ROW_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; | |
_[IN_ROW_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; | |
_[IN_ROW_MODE][Tokenizer.START_TAG_TOKEN] = startTagInRow; | |
_[IN_ROW_MODE][Tokenizer.END_TAG_TOKEN] = endTagInRow; | |
_[IN_ROW_MODE][Tokenizer.EOF_TOKEN] = eofInBody; | |
_[IN_CELL_MODE] = Object.create(null); | |
_[IN_CELL_MODE][Tokenizer.CHARACTER_TOKEN] = characterInBody; | |
_[IN_CELL_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; | |
_[IN_CELL_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody; | |
_[IN_CELL_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; | |
_[IN_CELL_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; | |
_[IN_CELL_MODE][Tokenizer.START_TAG_TOKEN] = startTagInCell; | |
_[IN_CELL_MODE][Tokenizer.END_TAG_TOKEN] = endTagInCell; | |
_[IN_CELL_MODE][Tokenizer.EOF_TOKEN] = eofInBody; | |
_[IN_SELECT_MODE] = Object.create(null); | |
_[IN_SELECT_MODE][Tokenizer.CHARACTER_TOKEN] = insertCharacters; | |
_[IN_SELECT_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; | |
_[IN_SELECT_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters; | |
_[IN_SELECT_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; | |
_[IN_SELECT_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; | |
_[IN_SELECT_MODE][Tokenizer.START_TAG_TOKEN] = startTagInSelect; | |
_[IN_SELECT_MODE][Tokenizer.END_TAG_TOKEN] = endTagInSelect; | |
_[IN_SELECT_MODE][Tokenizer.EOF_TOKEN] = eofInBody; | |
_[IN_SELECT_IN_TABLE_MODE] = Object.create(null); | |
_[IN_SELECT_IN_TABLE_MODE][Tokenizer.CHARACTER_TOKEN] = insertCharacters; | |
_[IN_SELECT_IN_TABLE_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; | |
_[IN_SELECT_IN_TABLE_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters; | |
_[IN_SELECT_IN_TABLE_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; | |
_[IN_SELECT_IN_TABLE_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; | |
_[IN_SELECT_IN_TABLE_MODE][Tokenizer.START_TAG_TOKEN] = startTagInSelectInTable; | |
_[IN_SELECT_IN_TABLE_MODE][Tokenizer.END_TAG_TOKEN] = endTagInSelectInTable; | |
_[IN_SELECT_IN_TABLE_MODE][Tokenizer.EOF_TOKEN] = eofInBody; | |
_[IN_TEMPLATE_MODE] = Object.create(null); | |
_[IN_TEMPLATE_MODE][Tokenizer.CHARACTER_TOKEN] = characterInBody; | |
_[IN_TEMPLATE_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; | |
_[IN_TEMPLATE_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody; | |
_[IN_TEMPLATE_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; | |
_[IN_TEMPLATE_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; | |
_[IN_TEMPLATE_MODE][Tokenizer.START_TAG_TOKEN] = startTagInTemplate; | |
_[IN_TEMPLATE_MODE][Tokenizer.END_TAG_TOKEN] = endTagInTemplate; | |
_[IN_TEMPLATE_MODE][Tokenizer.EOF_TOKEN] = eofInTemplate; | |
_[AFTER_BODY_MODE] = Object.create(null); | |
_[AFTER_BODY_MODE][Tokenizer.CHARACTER_TOKEN] = | |
_[AFTER_BODY_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenAfterBody; | |
_[AFTER_BODY_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody; | |
_[AFTER_BODY_MODE][Tokenizer.COMMENT_TOKEN] = appendCommentToRootHtmlElement; | |
_[AFTER_BODY_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; | |
_[AFTER_BODY_MODE][Tokenizer.START_TAG_TOKEN] = startTagAfterBody; | |
_[AFTER_BODY_MODE][Tokenizer.END_TAG_TOKEN] = endTagAfterBody; | |
_[AFTER_BODY_MODE][Tokenizer.EOF_TOKEN] = stopParsing; | |
_[IN_FRAMESET_MODE] = Object.create(null); | |
_[IN_FRAMESET_MODE][Tokenizer.CHARACTER_TOKEN] = | |
_[IN_FRAMESET_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; | |
_[IN_FRAMESET_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters; | |
_[IN_FRAMESET_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; | |
_[IN_FRAMESET_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; | |
_[IN_FRAMESET_MODE][Tokenizer.START_TAG_TOKEN] = startTagInFrameset; | |
_[IN_FRAMESET_MODE][Tokenizer.END_TAG_TOKEN] = endTagInFrameset; | |
_[IN_FRAMESET_MODE][Tokenizer.EOF_TOKEN] = stopParsing; | |
_[AFTER_FRAMESET_MODE] = Object.create(null); | |
_[AFTER_FRAMESET_MODE][Tokenizer.CHARACTER_TOKEN] = | |
_[AFTER_FRAMESET_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; | |
_[AFTER_FRAMESET_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters; | |
_[AFTER_FRAMESET_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; | |
_[AFTER_FRAMESET_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; | |
_[AFTER_FRAMESET_MODE][Tokenizer.START_TAG_TOKEN] = startTagAfterFrameset; | |
_[AFTER_FRAMESET_MODE][Tokenizer.END_TAG_TOKEN] = endTagAfterFrameset; | |
_[AFTER_FRAMESET_MODE][Tokenizer.EOF_TOKEN] = stopParsing; | |
_[AFTER_AFTER_BODY_MODE] = Object.create(null); | |
_[AFTER_AFTER_BODY_MODE][Tokenizer.CHARACTER_TOKEN] = tokenAfterAfterBody; | |
_[AFTER_AFTER_BODY_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenAfterAfterBody; | |
_[AFTER_AFTER_BODY_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody; | |
_[AFTER_AFTER_BODY_MODE][Tokenizer.COMMENT_TOKEN] = appendCommentToDocument; | |
_[AFTER_AFTER_BODY_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; | |
_[AFTER_AFTER_BODY_MODE][Tokenizer.START_TAG_TOKEN] = startTagAfterAfterBody; | |
_[AFTER_AFTER_BODY_MODE][Tokenizer.END_TAG_TOKEN] = tokenAfterAfterBody; | |
_[AFTER_AFTER_BODY_MODE][Tokenizer.EOF_TOKEN] = stopParsing; | |
_[AFTER_AFTER_FRAMESET_MODE] = Object.create(null); | |
_[AFTER_AFTER_FRAMESET_MODE][Tokenizer.CHARACTER_TOKEN] = | |
_[AFTER_AFTER_FRAMESET_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; | |
_[AFTER_AFTER_FRAMESET_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody; | |
_[AFTER_AFTER_FRAMESET_MODE][Tokenizer.COMMENT_TOKEN] = appendCommentToDocument; | |
_[AFTER_AFTER_FRAMESET_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; | |
_[AFTER_AFTER_FRAMESET_MODE][Tokenizer.START_TAG_TOKEN] = startTagAfterAfterFrameset; | |
_[AFTER_AFTER_FRAMESET_MODE][Tokenizer.END_TAG_TOKEN] = ignoreToken; | |
_[AFTER_AFTER_FRAMESET_MODE][Tokenizer.EOF_TOKEN] = stopParsing; | |
//Parser | |
var Parser = module.exports = function (options) { | |
this.options = mergeOptions(DEFAULT_OPTIONS, options); | |
this.treeAdapter = this.options.treeAdapter; | |
this.pendingScript = null; | |
if (this.options.locationInfo) | |
locationInfoMixin.assign(this); | |
}; | |
// API | |
Parser.prototype.parse = function (html) { | |
var document = this.treeAdapter.createDocument(); | |
this._bootstrap(document, null); | |
this.tokenizer.write(html, true); | |
this._runParsingLoop(null); | |
return document; | |
}; | |
Parser.prototype.parseFragment = function (html, fragmentContext) { | |
//NOTE: use <template> element as a fragment context if context element was not provided, | |
//so we will parse in "forgiving" manner | |
if (!fragmentContext) | |
fragmentContext = this.treeAdapter.createElement($.TEMPLATE, NS.HTML, []); | |
//NOTE: create fake element which will be used as 'document' for fragment parsing. | |
//This is important for jsdom there 'document' can't be recreated, therefore | |
//fragment parsing causes messing of the main `document`. | |
var documentMock = this.treeAdapter.createElement('documentmock', NS.HTML, []); | |
this._bootstrap(documentMock, fragmentContext); | |
if (this.treeAdapter.getTagName(fragmentContext) === $.TEMPLATE) | |
this._pushTmplInsertionMode(IN_TEMPLATE_MODE); | |
this._initTokenizerForFragmentParsing(); | |
this._insertFakeRootElement(); | |
this._resetInsertionMode(); | |
this._findFormInFragmentContext(); | |
this.tokenizer.write(html, true); | |
this._runParsingLoop(null); | |
var rootElement = this.treeAdapter.getFirstChild(documentMock), | |
fragment = this.treeAdapter.createDocumentFragment(); | |
this._adoptNodes(rootElement, fragment); | |
return fragment; | |
}; | |
//Bootstrap parser | |
Parser.prototype._bootstrap = function (document, fragmentContext) { | |
this.tokenizer = new Tokenizer(this.options); | |
this.stopped = false; | |
this.insertionMode = INITIAL_MODE; | |
this.originalInsertionMode = ''; | |
this.document = document; | |
this.fragmentContext = fragmentContext; | |
this.headElement = null; | |
this.formElement = null; | |
this.openElements = new OpenElementStack(this.document, this.treeAdapter); | |
this.activeFormattingElements = new FormattingElementList(this.treeAdapter); | |
this.tmplInsertionModeStack = []; | |
this.tmplInsertionModeStackTop = -1; | |
this.currentTmplInsertionMode = null; | |
this.pendingCharacterTokens = []; | |
this.hasNonWhitespacePendingCharacterToken = false; | |
this.framesetOk = true; | |
this.skipNextNewLine = false; | |
this.fosterParentingEnabled = false; | |
}; | |
//Parsing loop | |
Parser.prototype._runParsingLoop = function (scriptHandler) { | |
while (!this.stopped) { | |
this._setupTokenizerCDATAMode(); | |
var token = this.tokenizer.getNextToken(); | |
if (token.type === Tokenizer.HIBERNATION_TOKEN) | |
break; | |
if (this.skipNextNewLine) { | |
this.skipNextNewLine = false; | |
if (token.type === Tokenizer.WHITESPACE_CHARACTER_TOKEN && token.chars[0] === '\n') { | |
if (token.chars.length === 1) | |
continue; | |
token.chars = token.chars.substr(1); | |
} | |
} | |
this._processInputToken(token); | |
if (scriptHandler && this.pendingScript) | |
break; | |
} | |
}; | |
Parser.prototype.runParsingLoopForCurrentChunk = function (writeCallback, scriptHandler) { | |
this._runParsingLoop(scriptHandler); | |
if (scriptHandler && this.pendingScript) { | |
var script = this.pendingScript; | |
this.pendingScript = null; | |
scriptHandler(script); | |
return; | |
} | |
if (writeCallback) | |
writeCallback(); | |
}; | |
//Text parsing | |
Parser.prototype._setupTokenizerCDATAMode = function () { | |
var current = this._getAdjustedCurrentElement(); | |
this.tokenizer.allowCDATA = current && current !== this.document && | |
this.treeAdapter.getNamespaceURI(current) !== NS.HTML && !this._isIntegrationPoint(current); | |
}; | |
Parser.prototype._switchToTextParsing = function (currentToken, nextTokenizerState) { | |
this._insertElement(currentToken, NS.HTML); | |
this.tokenizer.state = nextTokenizerState; | |
this.originalInsertionMode = this.insertionMode; | |
this.insertionMode = TEXT_MODE; | |
}; | |
Parser.prototype.switchToPlaintextParsing = function () { | |
this.insertionMode = TEXT_MODE; | |
this.originalInsertionMode = IN_BODY_MODE; | |
this.tokenizer.state = Tokenizer.MODE.PLAINTEXT; | |
}; | |
//Fragment parsing | |
Parser.prototype._getAdjustedCurrentElement = function () { | |
return this.openElements.stackTop === 0 && this.fragmentContext ? | |
this.fragmentContext : | |
this.openElements.current; | |
}; | |
Parser.prototype._findFormInFragmentContext = function () { | |
var node = this.fragmentContext; | |
do { | |
if (this.treeAdapter.getTagName(node) === $.FORM) { | |
this.formElement = node; | |
break; | |
} | |
node = this.treeAdapter.getParentNode(node); | |
} while (node); | |
}; | |
Parser.prototype._initTokenizerForFragmentParsing = function () { | |
if (this.treeAdapter.getNamespaceURI(this.fragmentContext) === NS.HTML) { | |
var tn = this.treeAdapter.getTagName(this.fragmentContext); | |
if (tn === $.TITLE || tn === $.TEXTAREA) | |
this.tokenizer.state = Tokenizer.MODE.RCDATA; | |
else if (tn === $.STYLE || tn === $.XMP || tn === $.IFRAME || | |
tn === $.NOEMBED || tn === $.NOFRAMES || tn === $.NOSCRIPT) | |
this.tokenizer.state = Tokenizer.MODE.RAWTEXT; | |
else if (tn === $.SCRIPT) | |
this.tokenizer.state = Tokenizer.MODE.SCRIPT_DATA; | |
else if (tn === $.PLAINTEXT) | |
this.tokenizer.state = Tokenizer.MODE.PLAINTEXT; | |
} | |
}; | |
//Tree mutation | |
Parser.prototype._setDocumentType = function (token) { | |
this.treeAdapter.setDocumentType(this.document, token.name, token.publicId, token.systemId); | |
}; | |
Parser.prototype._attachElementToTree = function (element) { | |
if (this._shouldFosterParentOnInsertion()) | |
this._fosterParentElement(element); | |
else { | |
var parent = this.openElements.currentTmplContent || this.openElements.current; | |
this.treeAdapter.appendChild(parent, element); | |
} | |
}; | |
Parser.prototype._appendElement = function (token, namespaceURI) { | |
var element = this.treeAdapter.createElement(token.tagName, namespaceURI, token.attrs); | |
this._attachElementToTree(element); | |
}; | |
Parser.prototype._insertElement = function (token, namespaceURI) { | |
var element = this.treeAdapter.createElement(token.tagName, namespaceURI, token.attrs); | |
this._attachElementToTree(element); | |
this.openElements.push(element); | |
}; | |
Parser.prototype._insertFakeElement = function (tagName) { | |
var element = this.treeAdapter.createElement(tagName, NS.HTML, []); | |
this._attachElementToTree(element); | |
this.openElements.push(element); | |
}; | |
Parser.prototype._insertTemplate = function (token) { | |
var tmpl = this.treeAdapter.createElement(token.tagName, NS.HTML, token.attrs), | |
content = this.treeAdapter.createDocumentFragment(); | |
this.treeAdapter.setTemplateContent(tmpl, content); | |
this._attachElementToTree(tmpl); | |
this.openElements.push(tmpl); | |
}; | |
Parser.prototype._insertFakeRootElement = function () { | |
var element = this.treeAdapter.createElement($.HTML, NS.HTML, []); | |
this.treeAdapter.appendChild(this.openElements.current, element); | |
this.openElements.push(element); | |
}; | |
Parser.prototype._appendCommentNode = function (token, parent) { | |
var commentNode = this.treeAdapter.createCommentNode(token.data); | |
this.treeAdapter.appendChild(parent, commentNode); | |
}; | |
Parser.prototype._insertCharacters = function (token) { | |
if (this._shouldFosterParentOnInsertion()) | |
this._fosterParentText(token.chars); | |
else { | |
var parent = this.openElements.currentTmplContent || this.openElements.current; | |
this.treeAdapter.insertText(parent, token.chars); | |
} | |
}; | |
Parser.prototype._adoptNodes = function (donor, recipient) { | |
while (true) { | |
var child = this.treeAdapter.getFirstChild(donor); | |
if (!child) | |
break; | |
this.treeAdapter.detachNode(child); | |
this.treeAdapter.appendChild(recipient, child); | |
} | |
}; | |
//Token processing | |
Parser.prototype._shouldProcessTokenInForeignContent = function (token) { | |
var current = this._getAdjustedCurrentElement(); | |
if (!current || current === this.document) | |
return false; | |
var ns = this.treeAdapter.getNamespaceURI(current); | |
if (ns === NS.HTML) | |
return false; | |
if (this.treeAdapter.getTagName(current) === $.ANNOTATION_XML && ns === NS.MATHML && | |
token.type === Tokenizer.START_TAG_TOKEN && token.tagName === $.SVG) | |
return false; | |
var isCharacterToken = token.type === Tokenizer.CHARACTER_TOKEN || | |
token.type === Tokenizer.NULL_CHARACTER_TOKEN || | |
token.type === Tokenizer.WHITESPACE_CHARACTER_TOKEN, | |
isMathMLTextStartTag = token.type === Tokenizer.START_TAG_TOKEN && | |
token.tagName !== $.MGLYPH && | |
token.tagName !== $.MALIGNMARK; | |
if ((isMathMLTextStartTag || isCharacterToken) && this._isIntegrationPoint(current, NS.MATHML)) | |
return false; | |
if ((token.type === Tokenizer.START_TAG_TOKEN || isCharacterToken) && this._isIntegrationPoint(current, NS.HTML)) | |
return false; | |
return token.type !== Tokenizer.EOF_TOKEN; | |
}; | |
Parser.prototype._processToken = function (token) { | |
_[this.insertionMode][token.type](this, token); | |
}; | |
Parser.prototype._processTokenInBodyMode = function (token) { | |
_[IN_BODY_MODE][token.type](this, token); | |
}; | |
Parser.prototype._processTokenInForeignContent = function (token) { | |
if (token.type === Tokenizer.CHARACTER_TOKEN) | |
characterInForeignContent(this, token); | |
else if (token.type === Tokenizer.NULL_CHARACTER_TOKEN) | |
nullCharacterInForeignContent(this, token); | |
else if (token.type === Tokenizer.WHITESPACE_CHARACTER_TOKEN) | |
insertCharacters(this, token); | |
else if (token.type === Tokenizer.COMMENT_TOKEN) | |
appendComment(this, token); | |
else if (token.type === Tokenizer.START_TAG_TOKEN) | |
startTagInForeignContent(this, token); | |
else if (token.type === Tokenizer.END_TAG_TOKEN) | |
endTagInForeignContent(this, token); | |
}; | |
Parser.prototype._processInputToken = function (token) { | |
if (this._shouldProcessTokenInForeignContent(token)) | |
this._processTokenInForeignContent(token); | |
else | |
this._processToken(token); | |
}; | |
//Integration points | |
Parser.prototype._isIntegrationPoint = function (element, foreignNS) { | |
var tn = this.treeAdapter.getTagName(element), | |
ns = this.treeAdapter.getNamespaceURI(element), | |
attrs = this.treeAdapter.getAttrList(element); | |
return foreignContent.isIntegrationPoint(tn, ns, attrs, foreignNS); | |
}; | |
//Active formatting elements reconstruction | |
Parser.prototype._reconstructActiveFormattingElements = function () { | |
var listLength = this.activeFormattingElements.length; | |
if (listLength) { | |
var unopenIdx = listLength, | |
entry = null; | |
do { | |
unopenIdx--; | |
entry = this.activeFormattingElements.entries[unopenIdx]; | |
if (entry.type === FormattingElementList.MARKER_ENTRY || this.openElements.contains(entry.element)) { | |
unopenIdx++; | |
break; | |
} | |
} while (unopenIdx > 0); | |
for (var i = unopenIdx; i < listLength; i++) { | |
entry = this.activeFormattingElements.entries[i]; | |
this._insertElement(entry.token, this.treeAdapter.getNamespaceURI(entry.element)); | |
entry.element = this.openElements.current; | |
} | |
} | |
}; | |
//Close elements | |
Parser.prototype._closeTableCell = function () { | |
this.openElements.generateImpliedEndTags(); | |
this.openElements.popUntilTableCellPopped(); | |
this.activeFormattingElements.clearToLastMarker(); | |
this.insertionMode = IN_ROW_MODE; | |
}; | |
Parser.prototype._closePElement = function () { | |
this.openElements.generateImpliedEndTagsWithExclusion($.P); | |
this.openElements.popUntilTagNamePopped($.P); | |
}; | |
//Insertion modes | |
Parser.prototype._resetInsertionMode = function () { | |
for (var i = this.openElements.stackTop, last = false; i >= 0; i--) { | |
var element = this.openElements.items[i]; | |
if (i === 0) { | |
last = true; | |
if (this.fragmentContext) | |
element = this.fragmentContext; | |
} | |
var tn = this.treeAdapter.getTagName(element), | |
newInsertionMode = INSERTION_MODE_RESET_MAP[tn]; | |
if (newInsertionMode) { | |
this.insertionMode = newInsertionMode; | |
break; | |
} | |
else if (!last && (tn === $.TD || tn === $.TH)) { | |
this.insertionMode = IN_CELL_MODE; | |
break; | |
} | |
else if (!last && tn === $.HEAD) { | |
this.insertionMode = IN_HEAD_MODE; | |
break; | |
} | |
else if (tn === $.SELECT) { | |
this._resetInsertionModeForSelect(i); | |
break; | |
} | |
else if (tn === $.TEMPLATE) { | |
this.insertionMode = this.currentTmplInsertionMode; | |
break; | |
} | |
else if (tn === $.HTML) { | |
this.insertionMode = this.headElement ? AFTER_HEAD_MODE : BEFORE_HEAD_MODE; | |
break; | |
} | |
else if (last) { | |
this.insertionMode = IN_BODY_MODE; | |
break; | |
} | |
} | |
}; | |
Parser.prototype._resetInsertionModeForSelect = function (selectIdx) { | |
if (selectIdx > 0) { | |
for (var i = selectIdx - 1; i > 0; i--) { | |
var ancestor = this.openElements.items[i], | |
tn = this.treeAdapter.getTagName(ancestor); | |
if (tn === $.TEMPLATE) | |
break; | |
else if (tn === $.TABLE) { | |
this.insertionMode = IN_SELECT_IN_TABLE_MODE; | |
return; | |
} | |
} | |
} | |
this.insertionMode = IN_SELECT_MODE; | |
}; | |
Parser.prototype._pushTmplInsertionMode = function (mode) { | |
this.tmplInsertionModeStack.push(mode); | |
this.tmplInsertionModeStackTop++; | |
this.currentTmplInsertionMode = mode; | |
}; | |
Parser.prototype._popTmplInsertionMode = function () { | |
this.tmplInsertionModeStack.pop(); | |
this.tmplInsertionModeStackTop--; | |
this.currentTmplInsertionMode = this.tmplInsertionModeStack[this.tmplInsertionModeStackTop]; | |
}; | |
//Foster parenting | |
Parser.prototype._isElementCausesFosterParenting = function (element) { | |
var tn = this.treeAdapter.getTagName(element); | |
return tn === $.TABLE || tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD || tn === $.TR; | |
}; | |
Parser.prototype._shouldFosterParentOnInsertion = function () { | |
return this.fosterParentingEnabled && this._isElementCausesFosterParenting(this.openElements.current); | |
}; | |
Parser.prototype._findFosterParentingLocation = function () { | |
var location = { | |
parent: null, | |
beforeElement: null | |
}; | |
for (var i = this.openElements.stackTop; i >= 0; i--) { | |
var openElement = this.openElements.items[i], | |
tn = this.treeAdapter.getTagName(openElement), | |
ns = this.treeAdapter.getNamespaceURI(openElement); | |
if (tn === $.TEMPLATE && ns === NS.HTML) { | |
location.parent = this.treeAdapter.getTemplateContent(openElement); | |
break; | |
} | |
else if (tn === $.TABLE) { | |
location.parent = this.treeAdapter.getParentNode(openElement); | |
if (location.parent) | |
location.beforeElement = openElement; | |
else | |
location.parent = this.openElements.items[i - 1]; | |
break; | |
} | |
} | |
if (!location.parent) | |
location.parent = this.openElements.items[0]; | |
return location; | |
}; | |
Parser.prototype._fosterParentElement = function (element) { | |
var location = this._findFosterParentingLocation(); | |
if (location.beforeElement) | |
this.treeAdapter.insertBefore(location.parent, element, location.beforeElement); | |
else | |
this.treeAdapter.appendChild(location.parent, element); | |
}; | |
Parser.prototype._fosterParentText = function (chars) { | |
var location = this._findFosterParentingLocation(); | |
if (location.beforeElement) | |
this.treeAdapter.insertTextBefore(location.parent, chars, location.beforeElement); | |
else | |
this.treeAdapter.insertText(location.parent, chars); | |
}; | |
//Special elements | |
Parser.prototype._isSpecialElement = function (element) { | |
var tn = this.treeAdapter.getTagName(element), | |
ns = this.treeAdapter.getNamespaceURI(element); | |
return HTML.SPECIAL_ELEMENTS[ns][tn]; | |
}; | |
//Adoption agency algorithm | |
//(see: http://www.whatwg.org/specs/web-apps/current-work/multipage/tree-construction.html#adoptionAgency) | |
//------------------------------------------------------------------ | |
//Steps 5-8 of the algorithm | |
function aaObtainFormattingElementEntry(p, token) { | |
var formattingElementEntry = p.activeFormattingElements.getElementEntryInScopeWithTagName(token.tagName); | |
if (formattingElementEntry) { | |
if (!p.openElements.contains(formattingElementEntry.element)) { | |
p.activeFormattingElements.removeEntry(formattingElementEntry); | |
formattingElementEntry = null; | |
} | |
else if (!p.openElements.hasInScope(token.tagName)) | |
formattingElementEntry = null; | |
} | |
else | |
genericEndTagInBody(p, token); | |
return formattingElementEntry; | |
} | |
//Steps 9 and 10 of the algorithm | |
function aaObtainFurthestBlock(p, formattingElementEntry) { | |
var furthestBlock = null; | |
for (var i = p.openElements.stackTop; i >= 0; i--) { | |
var element = p.openElements.items[i]; | |
if (element === formattingElementEntry.element) | |
break; | |
if (p._isSpecialElement(element)) | |
furthestBlock = element; | |
} | |
if (!furthestBlock) { | |
p.openElements.popUntilElementPopped(formattingElementEntry.element); | |
p.activeFormattingElements.removeEntry(formattingElementEntry); | |
} | |
return furthestBlock; | |
} | |
//Step 13 of the algorithm | |
function aaInnerLoop(p, furthestBlock, formattingElement) { | |
var lastElement = furthestBlock, | |
nextElement = p.openElements.getCommonAncestor(furthestBlock); | |
for (var i = 0, element = nextElement; element !== formattingElement; i++, element = nextElement) { | |
//NOTE: store next element for the next loop iteration (it may be deleted from the stack by step 9.5) | |
nextElement = p.openElements.getCommonAncestor(element); | |
var elementEntry = p.activeFormattingElements.getElementEntry(element), | |
counterOverflow = elementEntry && i >= AA_INNER_LOOP_ITER, | |
shouldRemoveFromOpenElements = !elementEntry || counterOverflow; | |
if (shouldRemoveFromOpenElements) { | |
if (counterOverflow) | |
p.activeFormattingElements.removeEntry(elementEntry); | |
p.openElements.remove(element); | |
} | |
else { | |
element = aaRecreateElementFromEntry(p, elementEntry); | |
if (lastElement === furthestBlock) | |
p.activeFormattingElements.bookmark = elementEntry; | |
p.treeAdapter.detachNode(lastElement); | |
p.treeAdapter.appendChild(element, lastElement); | |
lastElement = element; | |
} | |
} | |
return lastElement; | |
} | |
//Step 13.7 of the algorithm | |
function aaRecreateElementFromEntry(p, elementEntry) { | |
var ns = p.treeAdapter.getNamespaceURI(elementEntry.element), | |
newElement = p.treeAdapter.createElement(elementEntry.token.tagName, ns, elementEntry.token.attrs); | |
p.openElements.replace(elementEntry.element, newElement); | |
elementEntry.element = newElement; | |
return newElement; | |
} | |
//Step 14 of the algorithm | |
function aaInsertLastNodeInCommonAncestor(p, commonAncestor, lastElement) { | |
if (p._isElementCausesFosterParenting(commonAncestor)) | |
p._fosterParentElement(lastElement); | |
else { | |
var tn = p.treeAdapter.getTagName(commonAncestor), | |
ns = p.treeAdapter.getNamespaceURI(commonAncestor); | |
if (tn === $.TEMPLATE && ns === NS.HTML) | |
commonAncestor = p.treeAdapter.getTemplateContent(commonAncestor); | |
p.treeAdapter.appendChild(commonAncestor, lastElement); | |
} | |
} | |
//Steps 15-19 of the algorithm | |
function aaReplaceFormattingElement(p, furthestBlock, formattingElementEntry) { | |
var ns = p.treeAdapter.getNamespaceURI(formattingElementEntry.element), | |
token = formattingElementEntry.token, | |
newElement = p.treeAdapter.createElement(token.tagName, ns, token.attrs); | |
p._adoptNodes(furthestBlock, newElement); | |
p.treeAdapter.appendChild(furthestBlock, newElement); | |
p.activeFormattingElements.insertElementAfterBookmark(newElement, formattingElementEntry.token); | |
p.activeFormattingElements.removeEntry(formattingElementEntry); | |
p.openElements.remove(formattingElementEntry.element); | |
p.openElements.insertAfter(furthestBlock, newElement); | |
} | |
//Algorithm entry point | |
function callAdoptionAgency(p, token) { | |
var formattingElementEntry; | |
for (var i = 0; i < AA_OUTER_LOOP_ITER; i++) { | |
formattingElementEntry = aaObtainFormattingElementEntry(p, token, formattingElementEntry); | |
if (!formattingElementEntry) | |
break; | |
var furthestBlock = aaObtainFurthestBlock(p, formattingElementEntry); | |
if (!furthestBlock) | |
break; | |
p.activeFormattingElements.bookmark = formattingElementEntry; | |
var lastElement = aaInnerLoop(p, furthestBlock, formattingElementEntry.element), | |
commonAncestor = p.openElements.getCommonAncestor(formattingElementEntry.element); | |
p.treeAdapter.detachNode(lastElement); | |
aaInsertLastNodeInCommonAncestor(p, commonAncestor, lastElement); | |
aaReplaceFormattingElement(p, furthestBlock, formattingElementEntry); | |
} | |
} | |
//Generic token handlers | |
//------------------------------------------------------------------ | |
function ignoreToken() { | |
//NOTE: do nothing =) | |
} | |
function appendComment(p, token) { | |
p._appendCommentNode(token, p.openElements.currentTmplContent || p.openElements.current); | |
} | |
function appendCommentToRootHtmlElement(p, token) { | |
p._appendCommentNode(token, p.openElements.items[0]); | |
} | |
function appendCommentToDocument(p, token) { | |
p._appendCommentNode(token, p.document); | |
} | |
function insertCharacters(p, token) { | |
p._insertCharacters(token); | |
} | |
function stopParsing(p) { | |
p.stopped = true; | |
} | |
//12.2.5.4.1 The "initial" insertion mode | |
//------------------------------------------------------------------ | |
function doctypeInInitialMode(p, token) { | |
p._setDocumentType(token); | |
var mode = token.forceQuirks ? | |
HTML.DOCUMENT_MODE.QUIRKS : | |
doctype.getDocumentMode(token.name, token.publicId, token.systemId); | |
p.treeAdapter.setDocumentMode(p.document, mode); | |
p.insertionMode = BEFORE_HTML_MODE; | |
} | |
function tokenInInitialMode(p, token) { | |
p.treeAdapter.setDocumentMode(p.document, HTML.DOCUMENT_MODE.QUIRKS); | |
p.insertionMode = BEFORE_HTML_MODE; | |
p._processToken(token); | |
} | |
//12.2.5.4.2 The "before html" insertion mode | |
//------------------------------------------------------------------ | |
function startTagBeforeHtml(p, token) { | |
if (token.tagName === $.HTML) { | |
p._insertElement(token, NS.HTML); | |
p.insertionMode = BEFORE_HEAD_MODE; | |
} | |
else | |
tokenBeforeHtml(p, token); | |
} | |
function endTagBeforeHtml(p, token) { | |
var tn = token.tagName; | |
if (tn === $.HTML || tn === $.HEAD || tn === $.BODY || tn === $.BR) | |
tokenBeforeHtml(p, token); | |
} | |
function tokenBeforeHtml(p, token) { | |
p._insertFakeRootElement(); | |
p.insertionMode = BEFORE_HEAD_MODE; | |
p._processToken(token); | |
} | |
//12.2.5.4.3 The "before head" insertion mode | |
//------------------------------------------------------------------ | |
function startTagBeforeHead(p, token) { | |
var tn = token.tagName; | |
if (tn === $.HTML) | |
startTagInBody(p, token); | |
else if (tn === $.HEAD) { | |
p._insertElement(token, NS.HTML); | |
p.headElement = p.openElements.current; | |
p.insertionMode = IN_HEAD_MODE; | |
} | |
else | |
tokenBeforeHead(p, token); | |
} | |
function endTagBeforeHead(p, token) { | |
var tn = token.tagName; | |
if (tn === $.HEAD || tn === $.BODY || tn === $.HTML || tn === $.BR) | |
tokenBeforeHead(p, token); | |
} | |
function tokenBeforeHead(p, token) { | |
p._insertFakeElement($.HEAD); | |
p.headElement = p.openElements.current; | |
p.insertionMode = IN_HEAD_MODE; | |
p._processToken(token); | |
} | |
//12.2.5.4.4 The "in head" insertion mode | |
//------------------------------------------------------------------ | |
function startTagInHead(p, token) { | |
var tn = token.tagName; | |
if (tn === $.HTML) | |
startTagInBody(p, token); | |
else if (tn === $.BASE || tn === $.BASEFONT || tn === $.BGSOUND || tn === $.LINK || tn === $.META) | |
p._appendElement(token, NS.HTML); | |
else if (tn === $.TITLE) | |
p._switchToTextParsing(token, Tokenizer.MODE.RCDATA); | |
//NOTE: here we assume that we always act as an interactive user agent with enabled scripting, so we parse | |
//<noscript> as a rawtext. | |
else if (tn === $.NOSCRIPT || tn === $.NOFRAMES || tn === $.STYLE) | |
p._switchToTextParsing(token, Tokenizer.MODE.RAWTEXT); | |
else if (tn === $.SCRIPT) | |
p._switchToTextParsing(token, Tokenizer.MODE.SCRIPT_DATA); | |
else if (tn === $.TEMPLATE) { | |
p._insertTemplate(token, NS.HTML); | |
p.activeFormattingElements.insertMarker(); | |
p.framesetOk = false; | |
p.insertionMode = IN_TEMPLATE_MODE; | |
p._pushTmplInsertionMode(IN_TEMPLATE_MODE); | |
} | |
else if (tn !== $.HEAD) | |
tokenInHead(p, token); | |
} | |
function endTagInHead(p, token) { | |
var tn = token.tagName; | |
if (tn === $.HEAD) { | |
p.openElements.pop(); | |
p.insertionMode = AFTER_HEAD_MODE; | |
} | |
else if (tn === $.BODY || tn === $.BR || tn === $.HTML) | |
tokenInHead(p, token); | |
else if (tn === $.TEMPLATE && p.openElements.tmplCount > 0) { | |
p.openElements.generateImpliedEndTags(); | |
p.openElements.popUntilTagNamePopped($.TEMPLATE); | |
p.activeFormattingElements.clearToLastMarker(); | |
p._popTmplInsertionMode(); | |
p._resetInsertionMode(); | |
} | |
} | |
function tokenInHead(p, token) { | |
p.openElements.pop(); | |
p.insertionMode = AFTER_HEAD_MODE; | |
p._processToken(token); | |
} | |
//12.2.5.4.6 The "after head" insertion mode | |
//------------------------------------------------------------------ | |
function startTagAfterHead(p, token) { | |
var tn = token.tagName; | |
if (tn === $.HTML) | |
startTagInBody(p, token); | |
else if (tn === $.BODY) { | |
p._insertElement(token, NS.HTML); | |
p.framesetOk = false; | |
p.insertionMode = IN_BODY_MODE; | |
} | |
else if (tn === $.FRAMESET) { | |
p._insertElement(token, NS.HTML); | |
p.insertionMode = IN_FRAMESET_MODE; | |
} | |
else if (tn === $.BASE || tn === $.BASEFONT || tn === $.BGSOUND || tn === $.LINK || tn === $.META || | |
tn === $.NOFRAMES || tn === $.SCRIPT || tn === $.STYLE || tn === $.TEMPLATE || tn === $.TITLE) { | |
p.openElements.push(p.headElement); | |
startTagInHead(p, token); | |
p.openElements.remove(p.headElement); | |
} | |
else if (tn !== $.HEAD) | |
tokenAfterHead(p, token); | |
} | |
function endTagAfterHead(p, token) { | |
var tn = token.tagName; | |
if (tn === $.BODY || tn === $.HTML || tn === $.BR) | |
tokenAfterHead(p, token); | |
else if (tn === $.TEMPLATE) | |
endTagInHead(p, token); | |
} | |
function tokenAfterHead(p, token) { | |
p._insertFakeElement($.BODY); | |
p.insertionMode = IN_BODY_MODE; | |
p._processToken(token); | |
} | |
//12.2.5.4.7 The "in body" insertion mode | |
//------------------------------------------------------------------ | |
function whitespaceCharacterInBody(p, token) { | |
p._reconstructActiveFormattingElements(); | |
p._insertCharacters(token); | |
} | |
function characterInBody(p, token) { | |
p._reconstructActiveFormattingElements(); | |
p._insertCharacters(token); | |
p.framesetOk = false; | |
} | |
function htmlStartTagInBody(p, token) { | |
if (p.openElements.tmplCount === 0) | |
p.treeAdapter.adoptAttributes(p.openElements.items[0], token.attrs); | |
} | |
function bodyStartTagInBody(p, token) { | |
var bodyElement = p.openElements.tryPeekProperlyNestedBodyElement(); | |
if (bodyElement && p.openElements.tmplCount === 0) { | |
p.framesetOk = false; | |
p.treeAdapter.adoptAttributes(bodyElement, token.attrs); | |
} | |
} | |
function framesetStartTagInBody(p, token) { | |
var bodyElement = p.openElements.tryPeekProperlyNestedBodyElement(); | |
if (p.framesetOk && bodyElement) { | |
p.treeAdapter.detachNode(bodyElement); | |
p.openElements.popAllUpToHtmlElement(); | |
p._insertElement(token, NS.HTML); | |
p.insertionMode = IN_FRAMESET_MODE; | |
} | |
} | |
function addressStartTagInBody(p, token) { | |
if (p.openElements.hasInButtonScope($.P)) | |
p._closePElement(); | |
p._insertElement(token, NS.HTML); | |
} | |
function numberedHeaderStartTagInBody(p, token) { | |
if (p.openElements.hasInButtonScope($.P)) | |
p._closePElement(); | |
var tn = p.openElements.currentTagName; | |
if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6) | |
p.openElements.pop(); | |
p._insertElement(token, NS.HTML); | |
} | |
function preStartTagInBody(p, token) { | |
if (p.openElements.hasInButtonScope($.P)) | |
p._closePElement(); | |
p._insertElement(token, NS.HTML); | |
//NOTE: If the next token is a U+000A LINE FEED (LF) character token, then ignore that token and move | |
//on to the next one. (Newlines at the start of pre blocks are ignored as an authoring convenience.) | |
p.skipNextNewLine = true; | |
p.framesetOk = false; | |
} | |
function formStartTagInBody(p, token) { | |
var inTemplate = p.openElements.tmplCount > 0; | |
if (!p.formElement || inTemplate) { | |
if (p.openElements.hasInButtonScope($.P)) | |
p._closePElement(); | |
p._insertElement(token, NS.HTML); | |
if (!inTemplate) | |
p.formElement = p.openElements.current; | |
} | |
} | |
function listItemStartTagInBody(p, token) { | |
p.framesetOk = false; | |
var tn = token.tagName; | |
for (var i = p.openElements.stackTop; i >= 0; i--) { | |
var element = p.openElements.items[i], | |
elementTn = p.treeAdapter.getTagName(element), | |
closeTn = null; | |
if (tn === $.LI && elementTn === $.LI) | |
closeTn = $.LI; | |
else if ((tn === $.DD || tn === $.DT) && (elementTn === $.DD || elementTn === $.DT)) | |
closeTn = elementTn; | |
if (closeTn) { | |
p.openElements.generateImpliedEndTagsWithExclusion(closeTn); | |
p.openElements.popUntilTagNamePopped(closeTn); | |
break; | |
} | |
if (elementTn !== $.ADDRESS && elementTn !== $.DIV && elementTn !== $.P && p._isSpecialElement(element)) | |
break; | |
} | |
if (p.openElements.hasInButtonScope($.P)) | |
p._closePElement(); | |
p._insertElement(token, NS.HTML); | |
} | |
function plaintextStartTagInBody(p, token) { | |
if (p.openElements.hasInButtonScope($.P)) | |
p._closePElement(); | |
p._insertElement(token, NS.HTML); | |
p.tokenizer.state = Tokenizer.MODE.PLAINTEXT; | |
} | |
function buttonStartTagInBody(p, token) { | |
if (p.openElements.hasInScope($.BUTTON)) { | |
p.openElements.generateImpliedEndTags(); | |
p.openElements.popUntilTagNamePopped($.BUTTON); | |
} | |
p._reconstructActiveFormattingElements(); | |
p._insertElement(token, NS.HTML); | |
p.framesetOk = false; | |
} | |
function aStartTagInBody(p, token) { | |
var activeElementEntry = p.activeFormattingElements.getElementEntryInScopeWithTagName($.A); | |
if (activeElementEntry) { | |
callAdoptionAgency(p, token); | |
p.openElements.remove(activeElementEntry.element); | |
p.activeFormattingElements.removeEntry(activeElementEntry); | |
} | |
p._reconstructActiveFormattingElements(); | |
p._insertElement(token, NS.HTML); | |
p.activeFormattingElements.pushElement(p.openElements.current, token); | |
} | |
function bStartTagInBody(p, token) { | |
p._reconstructActiveFormattingElements(); | |
p._insertElement(token, NS.HTML); | |
p.activeFormattingElements.pushElement(p.openElements.current, token); | |
} | |
function nobrStartTagInBody(p, token) { | |
p._reconstructActiveFormattingElements(); | |
if (p.openElements.hasInScope($.NOBR)) { | |
callAdoptionAgency(p, token); | |
p._reconstructActiveFormattingElements(); | |
} | |
p._insertElement(token, NS.HTML); | |
p.activeFormattingElements.pushElement(p.openElements.current, token); | |
} | |
function appletStartTagInBody(p, token) { | |
p._reconstructActiveFormattingElements(); | |
p._insertElement(token, NS.HTML); | |
p.activeFormattingElements.insertMarker(); | |
p.framesetOk = false; | |
} | |
function tableStartTagInBody(p, token) { | |
if (p.treeAdapter.getDocumentMode(p.document) !== HTML.DOCUMENT_MODE.QUIRKS && p.openElements.hasInButtonScope($.P)) | |
p._closePElement(); | |
p._insertElement(token, NS.HTML); | |
p.framesetOk = false; | |
p.insertionMode = IN_TABLE_MODE; | |
} | |
function areaStartTagInBody(p, token) { | |
p._reconstructActiveFormattingElements(); | |
p._appendElement(token, NS.HTML); | |
p.framesetOk = false; | |
} | |
function inputStartTagInBody(p, token) { | |
p._reconstructActiveFormattingElements(); | |
p._appendElement(token, NS.HTML); | |
var inputType = Tokenizer.getTokenAttr(token, ATTRS.TYPE); | |
if (!inputType || inputType.toLowerCase() !== HIDDEN_INPUT_TYPE) | |
p.framesetOk = false; | |
} | |
function paramStartTagInBody(p, token) { | |
p._appendElement(token, NS.HTML); | |
} | |
function hrStartTagInBody(p, token) { | |
if (p.openElements.hasInButtonScope($.P)) | |
p._closePElement(); | |
if (p.openElements.currentTagName === $.MENUITEM) | |
p.openElements.pop(); | |
p._appendElement(token, NS.HTML); | |
p.framesetOk = false; | |
} | |
function imageStartTagInBody(p, token) { | |
token.tagName = $.IMG; | |
areaStartTagInBody(p, token); | |
} | |
function textareaStartTagInBody(p, token) { | |
p._insertElement(token, NS.HTML); | |
//NOTE: If the next token is a U+000A LINE FEED (LF) character token, then ignore that token and move | |
//on to the next one. (Newlines at the start of textarea elements are ignored as an authoring convenience.) | |
p.skipNextNewLine = true; | |
p.tokenizer.state = Tokenizer.MODE.RCDATA; | |
p.originalInsertionMode = p.insertionMode; | |
p.framesetOk = false; | |
p.insertionMode = TEXT_MODE; | |
} | |
function xmpStartTagInBody(p, token) { | |
if (p.openElements.hasInButtonScope($.P)) | |
p._closePElement(); | |
p._reconstructActiveFormattingElements(); | |
p.framesetOk = false; | |
p._switchToTextParsing(token, Tokenizer.MODE.RAWTEXT); | |
} | |
function iframeStartTagInBody(p, token) { | |
p.framesetOk = false; | |
p._switchToTextParsing(token, Tokenizer.MODE.RAWTEXT); | |
} | |
//NOTE: here we assume that we always act as an user agent with enabled plugins, so we parse | |
//<noembed> as a rawtext. | |
function noembedStartTagInBody(p, token) { | |
p._switchToTextParsing(token, Tokenizer.MODE.RAWTEXT); | |
} | |
function selectStartTagInBody(p, token) { | |
p._reconstructActiveFormattingElements(); | |
p._insertElement(token, NS.HTML); | |
p.framesetOk = false; | |
if (p.insertionMode === IN_TABLE_MODE || | |
p.insertionMode === IN_CAPTION_MODE || | |
p.insertionMode === IN_TABLE_BODY_MODE || | |
p.insertionMode === IN_ROW_MODE || | |
p.insertionMode === IN_CELL_MODE) | |
p.insertionMode = IN_SELECT_IN_TABLE_MODE; | |
else | |
p.insertionMode = IN_SELECT_MODE; | |
} | |
function optgroupStartTagInBody(p, token) { | |
if (p.openElements.currentTagName === $.OPTION) | |
p.openElements.pop(); | |
p._reconstructActiveFormattingElements(); | |
p._insertElement(token, NS.HTML); | |
} | |
function rbStartTagInBody(p, token) { | |
if (p.openElements.hasInScope($.RUBY)) | |
p.openElements.generateImpliedEndTags(); | |
p._insertElement(token, NS.HTML); | |
} | |
function rtStartTagInBody(p, token) { | |
if (p.openElements.hasInScope($.RUBY)) | |
p.openElements.generateImpliedEndTagsWithExclusion($.RTC); | |
p._insertElement(token, NS.HTML); | |
} | |
function menuitemStartTagInBody(p, token) { | |
if (p.openElements.currentTagName === $.MENUITEM) | |
p.openElements.pop(); | |
// TODO needs clarification, see https://github.com/whatwg/html/pull/907/files#r73505877 | |
p._reconstructActiveFormattingElements(); | |
p._insertElement(token, NS.HTML); | |
} | |
function menuStartTagInBody(p, token) { | |
if (p.openElements.hasInButtonScope($.P)) | |
p._closePElement(); | |
if (p.openElements.currentTagName === $.MENUITEM) | |
p.openElements.pop(); | |
p._insertElement(token, NS.HTML); | |
} | |
function mathStartTagInBody(p, token) { | |
p._reconstructActiveFormattingElements(); | |
foreignContent.adjustTokenMathMLAttrs(token); | |
foreignContent.adjustTokenXMLAttrs(token); | |
if (token.selfClosing) | |
p._appendElement(token, NS.MATHML); | |
else | |
p._insertElement(token, NS.MATHML); | |
} | |
function svgStartTagInBody(p, token) { | |
p._reconstructActiveFormattingElements(); | |
foreignContent.adjustTokenSVGAttrs(token); | |
foreignContent.adjustTokenXMLAttrs(token); | |
if (token.selfClosing) | |
p._appendElement(token, NS.SVG); | |
else | |
p._insertElement(token, NS.SVG); | |
} | |
function genericStartTagInBody(p, token) { | |
p._reconstructActiveFormattingElements(); | |
p._insertElement(token, NS.HTML); | |
} | |
//OPTIMIZATION: Integer comparisons are low-cost, so we can use very fast tag name length filters here. | |
//It's faster than using dictionary. | |
function startTagInBody(p, token) { | |
var tn = token.tagName; | |
switch (tn.length) { | |
case 1: | |
if (tn === $.I || tn === $.S || tn === $.B || tn === $.U) | |
bStartTagInBody(p, token); | |
else if (tn === $.P) | |
addressStartTagInBody(p, token); | |
else if (tn === $.A) | |
aStartTagInBody(p, token); | |
else | |
genericStartTagInBody(p, token); | |
break; | |
case 2: | |
if (tn === $.DL || tn === $.OL || tn === $.UL) | |
addressStartTagInBody(p, token); | |
else if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6) | |
numberedHeaderStartTagInBody(p, token); | |
else if (tn === $.LI || tn === $.DD || tn === $.DT) | |
listItemStartTagInBody(p, token); | |
else if (tn === $.EM || tn === $.TT) | |
bStartTagInBody(p, token); | |
else if (tn === $.BR) | |
areaStartTagInBody(p, token); | |
else if (tn === $.HR) | |
hrStartTagInBody(p, token); | |
else if (tn === $.RB) | |
rbStartTagInBody(p, token); | |
else if (tn === $.RT || tn === $.RP) | |
rtStartTagInBody(p, token); | |
else if (tn !== $.TH && tn !== $.TD && tn !== $.TR) | |
genericStartTagInBody(p, token); | |
break; | |
case 3: | |
if (tn === $.DIV || tn === $.DIR || tn === $.NAV) | |
addressStartTagInBody(p, token); | |
else if (tn === $.PRE) | |
preStartTagInBody(p, token); | |
else if (tn === $.BIG) | |
bStartTagInBody(p, token); | |
else if (tn === $.IMG || tn === $.WBR) | |
areaStartTagInBody(p, token); | |
else if (tn === $.XMP) | |
xmpStartTagInBody(p, token); | |
else if (tn === $.SVG) | |
svgStartTagInBody(p, token); | |
else if (tn === $.RTC) | |
rbStartTagInBody(p, token); | |
else if (tn !== $.COL) | |
genericStartTagInBody(p, token); | |
break; | |
case 4: | |
if (tn === $.HTML) | |
htmlStartTagInBody(p, token); | |
else if (tn === $.BASE || tn === $.LINK || tn === $.META) | |
startTagInHead(p, token); | |
else if (tn === $.BODY) | |
bodyStartTagInBody(p, token); | |
else if (tn === $.MAIN) | |
addressStartTagInBody(p, token); | |
else if (tn === $.FORM) | |
formStartTagInBody(p, token); | |
else if (tn === $.CODE || tn === $.FONT) | |
bStartTagInBody(p, token); | |
else if (tn === $.NOBR) | |
nobrStartTagInBody(p, token); | |
else if (tn === $.AREA) | |
areaStartTagInBody(p, token); | |
else if (tn === $.MATH) | |
mathStartTagInBody(p, token); | |
else if (tn === $.MENU) | |
menuStartTagInBody(p, token); | |
else if (tn !== $.HEAD) | |
genericStartTagInBody(p, token); | |
break; | |
case 5: | |
if (tn === $.STYLE || tn === $.TITLE) | |
startTagInHead(p, token); | |
else if (tn === $.ASIDE) | |
addressStartTagInBody(p, token); | |
else if (tn === $.SMALL) | |
bStartTagInBody(p, token); | |
else if (tn === $.TABLE) | |
tableStartTagInBody(p, token); | |
else if (tn === $.EMBED) | |
areaStartTagInBody(p, token); | |
else if (tn === $.INPUT) | |
inputStartTagInBody(p, token); | |
else if (tn === $.PARAM || tn === $.TRACK) | |
paramStartTagInBody(p, token); | |
else if (tn === $.IMAGE) | |
imageStartTagInBody(p, token); | |
else if (tn !== $.FRAME && tn !== $.TBODY && tn !== $.TFOOT && tn !== $.THEAD) | |
genericStartTagInBody(p, token); | |
break; | |
case 6: | |
if (tn === $.SCRIPT) | |
startTagInHead(p, token); | |
else if (tn === $.CENTER || tn === $.FIGURE || tn === $.FOOTER || tn === $.HEADER || tn === $.HGROUP) | |
addressStartTagInBody(p, token); | |
else if (tn === $.BUTTON) | |
buttonStartTagInBody(p, token); | |
else if (tn === $.STRIKE || tn === $.STRONG) | |
bStartTagInBody(p, token); | |
else if (tn === $.APPLET || tn === $.OBJECT) | |
appletStartTagInBody(p, token); | |
else if (tn === $.KEYGEN) | |
areaStartTagInBody(p, token); | |
else if (tn === $.SOURCE) | |
paramStartTagInBody(p, token); | |
else if (tn === $.IFRAME) | |
iframeStartTagInBody(p, token); | |
else if (tn === $.SELECT) | |
selectStartTagInBody(p, token); | |
else if (tn === $.OPTION) | |
optgroupStartTagInBody(p, token); | |
else | |
genericStartTagInBody(p, token); | |
break; | |
case 7: | |
if (tn === $.BGSOUND) | |
startTagInHead(p, token); | |
else if (tn === $.DETAILS || tn === $.ADDRESS || tn === $.ARTICLE || tn === $.SECTION || tn === $.SUMMARY) | |
addressStartTagInBody(p, token); | |
else if (tn === $.LISTING) | |
preStartTagInBody(p, token); | |
else if (tn === $.MARQUEE) | |
appletStartTagInBody(p, token); | |
else if (tn === $.NOEMBED) | |
noembedStartTagInBody(p, token); | |
else if (tn !== $.CAPTION) | |
genericStartTagInBody(p, token); | |
break; | |
case 8: | |
if (tn === $.BASEFONT) | |
startTagInHead(p, token); | |
else if (tn === $.MENUITEM) | |
menuitemStartTagInBody(p, token); | |
else if (tn === $.FRAMESET) | |
framesetStartTagInBody(p, token); | |
else if (tn === $.FIELDSET) | |
addressStartTagInBody(p, token); | |
else if (tn === $.TEXTAREA) | |
textareaStartTagInBody(p, token); | |
else if (tn === $.TEMPLATE) | |
startTagInHead(p, token); | |
else if (tn === $.NOSCRIPT) | |
noembedStartTagInBody(p, token); | |
else if (tn === $.OPTGROUP) | |
optgroupStartTagInBody(p, token); | |
else if (tn !== $.COLGROUP) | |
genericStartTagInBody(p, token); | |
break; | |
case 9: | |
if (tn === $.PLAINTEXT) | |
plaintextStartTagInBody(p, token); | |
else | |
genericStartTagInBody(p, token); | |
break; | |
case 10: | |
if (tn === $.BLOCKQUOTE || tn === $.FIGCAPTION) | |
addressStartTagInBody(p, token); | |
else | |
genericStartTagInBody(p, token); | |
break; | |
default: | |
genericStartTagInBody(p, token); | |
} | |
} | |
function bodyEndTagInBody(p) { | |
if (p.openElements.hasInScope($.BODY)) | |
p.insertionMode = AFTER_BODY_MODE; | |
} | |
function htmlEndTagInBody(p, token) { | |
if (p.openElements.hasInScope($.BODY)) { | |
p.insertionMode = AFTER_BODY_MODE; | |
p._processToken(token); | |
} | |
} | |
function addressEndTagInBody(p, token) { | |
var tn = token.tagName; | |
if (p.openElements.hasInScope(tn)) { | |
p.openElements.generateImpliedEndTags(); | |
p.openElements.popUntilTagNamePopped(tn); | |
} | |
} | |
function formEndTagInBody(p) { | |
var inTemplate = p.openElements.tmplCount > 0, | |
formElement = p.formElement; | |
if (!inTemplate) | |
p.formElement = null; | |
if ((formElement || inTemplate) && p.openElements.hasInScope($.FORM)) { | |
p.openElements.generateImpliedEndTags(); | |
if (inTemplate) | |
p.openElements.popUntilTagNamePopped($.FORM); | |
else | |
p.openElements.remove(formElement); | |
} | |
} | |
function pEndTagInBody(p) { | |
if (!p.openElements.hasInButtonScope($.P)) | |
p._insertFakeElement($.P); | |
p._closePElement(); | |
} | |
function liEndTagInBody(p) { | |
if (p.openElements.hasInListItemScope($.LI)) { | |
p.openElements.generateImpliedEndTagsWithExclusion($.LI); | |
p.openElements.popUntilTagNamePopped($.LI); | |
} | |
} | |
function ddEndTagInBody(p, token) { | |
var tn = token.tagName; | |
if (p.openElements.hasInScope(tn)) { | |
p.openElements.generateImpliedEndTagsWithExclusion(tn); | |
p.openElements.popUntilTagNamePopped(tn); | |
} | |
} | |
function numberedHeaderEndTagInBody(p) { | |
if (p.openElements.hasNumberedHeaderInScope()) { | |
p.openElements.generateImpliedEndTags(); | |
p.openElements.popUntilNumberedHeaderPopped(); | |
} | |
} | |
function appletEndTagInBody(p, token) { | |
var tn = token.tagName; | |
if (p.openElements.hasInScope(tn)) { | |
p.openElements.generateImpliedEndTags(); | |
p.openElements.popUntilTagNamePopped(tn); | |
p.activeFormattingElements.clearToLastMarker(); | |
} | |
} | |
function brEndTagInBody(p) { | |
p._reconstructActiveFormattingElements(); | |
p._insertFakeElement($.BR); | |
p.openElements.pop(); | |
p.framesetOk = false; | |
} | |
function genericEndTagInBody(p, token) { | |
var tn = token.tagName; | |
for (var i = p.openElements.stackTop; i > 0; i--) { | |
var element = p.openElements.items[i]; | |
if (p.treeAdapter.getTagName(element) === tn) { | |
p.openElements.generateImpliedEndTagsWithExclusion(tn); | |
p.openElements.popUntilElementPopped(element); | |
break; | |
} | |
if (p._isSpecialElement(element)) | |
break; | |
} | |
} | |
//OPTIMIZATION: Integer comparisons are low-cost, so we can use very fast tag name length filters here. | |
//It's faster than using dictionary. | |
function endTagInBody(p, token) { | |
var tn = token.tagName; | |
switch (tn.length) { | |
case 1: | |
if (tn === $.A || tn === $.B || tn === $.I || tn === $.S || tn === $.U) | |
callAdoptionAgency(p, token); | |
else if (tn === $.P) | |
pEndTagInBody(p, token); | |
else | |
genericEndTagInBody(p, token); | |
break; | |
case 2: | |
if (tn === $.DL || tn === $.UL || tn === $.OL) | |
addressEndTagInBody(p, token); | |
else if (tn === $.LI) | |
liEndTagInBody(p, token); | |
else if (tn === $.DD || tn === $.DT) | |
ddEndTagInBody(p, token); | |
else if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6) | |
numberedHeaderEndTagInBody(p, token); | |
else if (tn === $.BR) | |
brEndTagInBody(p, token); | |
else if (tn === $.EM || tn === $.TT) | |
callAdoptionAgency(p, token); | |
else | |
genericEndTagInBody(p, token); | |
break; | |
case 3: | |
if (tn === $.BIG) | |
callAdoptionAgency(p, token); | |
else if (tn === $.DIR || tn === $.DIV || tn === $.NAV) | |
addressEndTagInBody(p, token); | |
else | |
genericEndTagInBody(p, token); | |
break; | |
case 4: | |
if (tn === $.BODY) | |
bodyEndTagInBody(p, token); | |
else if (tn === $.HTML) | |
htmlEndTagInBody(p, token); | |
else if (tn === $.FORM) | |
formEndTagInBody(p, token); | |
else if (tn === $.CODE || tn === $.FONT || tn === $.NOBR) | |
callAdoptionAgency(p, token); | |
else if (tn === $.MAIN || tn === $.MENU) | |
addressEndTagInBody(p, token); | |
else | |
genericEndTagInBody(p, token); | |
break; | |
case 5: | |
if (tn === $.ASIDE) | |
addressEndTagInBody(p, token); | |
else if (tn === $.SMALL) | |
callAdoptionAgency(p, token); | |
else | |
genericEndTagInBody(p, token); | |
break; | |
case 6: | |
if (tn === $.CENTER || tn === $.FIGURE || tn === $.FOOTER || tn === $.HEADER || tn === $.HGROUP) | |
addressEndTagInBody(p, token); | |
else if (tn === $.APPLET || tn === $.OBJECT) | |
appletEndTagInBody(p, token); | |
else if (tn === $.STRIKE || tn === $.STRONG) | |
callAdoptionAgency(p, token); | |
else | |
genericEndTagInBody(p, token); | |
break; | |
case 7: | |
if (tn === $.ADDRESS || tn === $.ARTICLE || tn === $.DETAILS || tn === $.SECTION || tn === $.SUMMARY) | |
addressEndTagInBody(p, token); | |
else if (tn === $.MARQUEE) | |
appletEndTagInBody(p, token); | |
else | |
genericEndTagInBody(p, token); | |
break; | |
case 8: | |
if (tn === $.FIELDSET) | |
addressEndTagInBody(p, token); | |
else if (tn === $.TEMPLATE) | |
endTagInHead(p, token); | |
else | |
genericEndTagInBody(p, token); | |
break; | |
case 10: | |
if (tn === $.BLOCKQUOTE || tn === $.FIGCAPTION) | |
addressEndTagInBody(p, token); | |
else | |
genericEndTagInBody(p, token); | |
break; | |
default : | |
genericEndTagInBody(p, token); | |
} | |
} | |
function eofInBody(p, token) { | |
if (p.tmplInsertionModeStackTop > -1) | |
eofInTemplate(p, token); | |
else | |
p.stopped = true; | |
} | |
//12.2.5.4.8 The "text" insertion mode | |
//------------------------------------------------------------------ | |
function endTagInText(p, token) { | |
if (token.tagName === $.SCRIPT) | |
p.pendingScript = p.openElements.current; | |
p.openElements.pop(); | |
p.insertionMode = p.originalInsertionMode; | |
} | |
function eofInText(p, token) { | |
p.openElements.pop(); | |
p.insertionMode = p.originalInsertionMode; | |
p._processToken(token); | |
} | |
//12.2.5.4.9 The "in table" insertion mode | |
//------------------------------------------------------------------ | |
function characterInTable(p, token) { | |
var curTn = p.openElements.currentTagName; | |
if (curTn === $.TABLE || curTn === $.TBODY || curTn === $.TFOOT || curTn === $.THEAD || curTn === $.TR) { | |
p.pendingCharacterTokens = []; | |
p.hasNonWhitespacePendingCharacterToken = false; | |
p.originalInsertionMode = p.insertionMode; | |
p.insertionMode = IN_TABLE_TEXT_MODE; | |
p._processToken(token); | |
} | |
else | |
tokenInTable(p, token); | |
} | |
function captionStartTagInTable(p, token) { | |
p.openElements.clearBackToTableContext(); | |
p.activeFormattingElements.insertMarker(); | |
p._insertElement(token, NS.HTML); | |
p.insertionMode = IN_CAPTION_MODE; | |
} | |
function colgroupStartTagInTable(p, token) { | |
p.openElements.clearBackToTableContext(); | |
p._insertElement(token, NS.HTML); | |
p.insertionMode = IN_COLUMN_GROUP_MODE; | |
} | |
function colStartTagInTable(p, token) { | |
p.openElements.clearBackToTableContext(); | |
p._insertFakeElement($.COLGROUP); | |
p.insertionMode = IN_COLUMN_GROUP_MODE; | |
p._processToken(token); | |
} | |
function tbodyStartTagInTable(p, token) { | |
p.openElements.clearBackToTableContext(); | |
p._insertElement(token, NS.HTML); | |
p.insertionMode = IN_TABLE_BODY_MODE; | |
} | |
function tdStartTagInTable(p, token) { | |
p.openElements.clearBackToTableContext(); | |
p._insertFakeElement($.TBODY); | |
p.insertionMode = IN_TABLE_BODY_MODE; | |
p._processToken(token); | |
} | |
function tableStartTagInTable(p, token) { | |
if (p.openElements.hasInTableScope($.TABLE)) { | |
p.openElements.popUntilTagNamePopped($.TABLE); | |
p._resetInsertionMode(); | |
p._processToken(token); | |
} | |
} | |
function inputStartTagInTable(p, token) { | |
var inputType = Tokenizer.getTokenAttr(token, ATTRS.TYPE); | |
if (inputType && inputType.toLowerCase() === HIDDEN_INPUT_TYPE) | |
p._appendElement(token, NS.HTML); | |
else | |
tokenInTable(p, token); | |
} | |
function formStartTagInTable(p, token) { | |
if (!p.formElement && p.openElements.tmplCount === 0) { | |
p._insertElement(token, NS.HTML); | |
p.formElement = p.openElements.current; | |
p.openElements.pop(); | |
} | |
} | |
function startTagInTable(p, token) { | |
var tn = token.tagName; | |
switch (tn.length) { | |
case 2: | |
if (tn === $.TD || tn === $.TH || tn === $.TR) | |
tdStartTagInTable(p, token); | |
else | |
tokenInTable(p, token); | |
break; | |
case 3: | |
if (tn === $.COL) | |
colStartTagInTable(p, token); | |
else | |
tokenInTable(p, token); | |
break; | |
case 4: | |
if (tn === $.FORM) | |
formStartTagInTable(p, token); | |
else | |
tokenInTable(p, token); | |
break; | |
case 5: | |
if (tn === $.TABLE) | |
tableStartTagInTable(p, token); | |
else if (tn === $.STYLE) | |
startTagInHead(p, token); | |
else if (tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD) | |
tbodyStartTagInTable(p, token); | |
else if (tn === $.INPUT) | |
inputStartTagInTable(p, token); | |
else | |
tokenInTable(p, token); | |
break; | |
case 6: | |
if (tn === $.SCRIPT) | |
startTagInHead(p, token); | |
else | |
tokenInTable(p, token); | |
break; | |
case 7: | |
if (tn === $.CAPTION) | |
captionStartTagInTable(p, token); | |
else | |
tokenInTable(p, token); | |
break; | |
case 8: | |
if (tn === $.COLGROUP) | |
colgroupStartTagInTable(p, token); | |
else if (tn === $.TEMPLATE) | |
startTagInHead(p, token); | |
else | |
tokenInTable(p, token); | |
break; | |
default: | |
tokenInTable(p, token); | |
} | |
} | |
function endTagInTable(p, token) { | |
var tn = token.tagName; | |
if (tn === $.TABLE) { | |
if (p.openElements.hasInTableScope($.TABLE)) { | |
p.openElements.popUntilTagNamePopped($.TABLE); | |
p._resetInsertionMode(); | |
} | |
} | |
else if (tn === $.TEMPLATE) | |
endTagInHead(p, token); | |
else if (tn !== $.BODY && tn !== $.CAPTION && tn !== $.COL && tn !== $.COLGROUP && tn !== $.HTML && | |
tn !== $.TBODY && tn !== $.TD && tn !== $.TFOOT && tn !== $.TH && tn !== $.THEAD && tn !== $.TR) | |
tokenInTable(p, token); | |
} | |
function tokenInTable(p, token) { | |
var savedFosterParentingState = p.fosterParentingEnabled; | |
p.fosterParentingEnabled = true; | |
p._processTokenInBodyMode(token); | |
p.fosterParentingEnabled = savedFosterParentingState; | |
} | |
//12.2.5.4.10 The "in table text" insertion mode | |
//------------------------------------------------------------------ | |
function whitespaceCharacterInTableText(p, token) { | |
p.pendingCharacterTokens.push(token); | |
} | |
function characterInTableText(p, token) { | |
p.pendingCharacterTokens.push(token); | |
p.hasNonWhitespacePendingCharacterToken = true; | |
} | |
function tokenInTableText(p, token) { | |
var i = 0; | |
if (p.hasNonWhitespacePendingCharacterToken) { | |
for (; i < p.pendingCharacterTokens.length; i++) | |
tokenInTable(p, p.pendingCharacterTokens[i]); | |
} | |
else { | |
for (; i < p.pendingCharacterTokens.length; i++) | |
p._insertCharacters(p.pendingCharacterTokens[i]); | |
} | |
p.insertionMode = p.originalInsertionMode; | |
p._processToken(token); | |
} | |
//12.2.5.4.11 The "in caption" insertion mode | |
//------------------------------------------------------------------ | |
function startTagInCaption(p, token) { | |
var tn = token.tagName; | |
if (tn === $.CAPTION || tn === $.COL || tn === $.COLGROUP || tn === $.TBODY || | |
tn === $.TD || tn === $.TFOOT || tn === $.TH || tn === $.THEAD || tn === $.TR) { | |
if (p.openElements.hasInTableScope($.CAPTION)) { | |
p.openElements.generateImpliedEndTags(); | |
p.openElements.popUntilTagNamePopped($.CAPTION); | |
p.activeFormattingElements.clearToLastMarker(); | |
p.insertionMode = IN_TABLE_MODE; | |
p._processToken(token); | |
} | |
} | |
else | |
startTagInBody(p, token); | |
} | |
function endTagInCaption(p, token) { | |
var tn = token.tagName; | |
if (tn === $.CAPTION || tn === $.TABLE) { | |
if (p.openElements.hasInTableScope($.CAPTION)) { | |
p.openElements.generateImpliedEndTags(); | |
p.openElements.popUntilTagNamePopped($.CAPTION); | |
p.activeFormattingElements.clearToLastMarker(); | |
p.insertionMode = IN_TABLE_MODE; | |
if (tn === $.TABLE) | |
p._processToken(token); | |
} | |
} | |
else if (tn !== $.BODY && tn !== $.COL && tn !== $.COLGROUP && tn !== $.HTML && tn !== $.TBODY && | |
tn !== $.TD && tn !== $.TFOOT && tn !== $.TH && tn !== $.THEAD && tn !== $.TR) | |
endTagInBody(p, token); | |
} | |
//12.2.5.4.12 The "in column group" insertion mode | |
//------------------------------------------------------------------ | |
function startTagInColumnGroup(p, token) { | |
var tn = token.tagName; | |
if (tn === $.HTML) | |
startTagInBody(p, token); | |
else if (tn === $.COL) | |
p._appendElement(token, NS.HTML); | |
else if (tn === $.TEMPLATE) | |
startTagInHead(p, token); | |
else | |
tokenInColumnGroup(p, token); | |
} | |
function endTagInColumnGroup(p, token) { | |
var tn = token.tagName; | |
if (tn === $.COLGROUP) { | |
if (p.openElements.currentTagName === $.COLGROUP) { | |
p.openElements.pop(); | |
p.insertionMode = IN_TABLE_MODE; | |
} | |
} | |
else if (tn === $.TEMPLATE) | |
endTagInHead(p, token); | |
else if (tn !== $.COL) | |
tokenInColumnGroup(p, token); | |
} | |
function tokenInColumnGroup(p, token) { | |
if (p.openElements.currentTagName === $.COLGROUP) { | |
p.openElements.pop(); | |
p.insertionMode = IN_TABLE_MODE; | |
p._processToken(token); | |
} | |
} | |
//12.2.5.4.13 The "in table body" insertion mode | |
//------------------------------------------------------------------ | |
function startTagInTableBody(p, token) { | |
var tn = token.tagName; | |
if (tn === $.TR) { | |
p.openElements.clearBackToTableBodyContext(); | |
p._insertElement(token, NS.HTML); | |
p.insertionMode = IN_ROW_MODE; | |
} | |
else if (tn === $.TH || tn === $.TD) { | |
p.openElements.clearBackToTableBodyContext(); | |
p._insertFakeElement($.TR); | |
p.insertionMode = IN_ROW_MODE; | |
p._processToken(token); | |
} | |
else if (tn === $.CAPTION || tn === $.COL || tn === $.COLGROUP || | |
tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD) { | |
if (p.openElements.hasTableBodyContextInTableScope()) { | |
p.openElements.clearBackToTableBodyContext(); | |
p.openElements.pop(); | |
p.insertionMode = IN_TABLE_MODE; | |
p._processToken(token); | |
} | |
} | |
else | |
startTagInTable(p, token); | |
} | |
function endTagInTableBody(p, token) { | |
var tn = token.tagName; | |
if (tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD) { | |
if (p.openElements.hasInTableScope(tn)) { | |
p.openElements.clearBackToTableBodyContext(); | |
p.openElements.pop(); | |
p.insertionMode = IN_TABLE_MODE; | |
} | |
} | |
else if (tn === $.TABLE) { | |
if (p.openElements.hasTableBodyContextInTableScope()) { | |
p.openElements.clearBackToTableBodyContext(); | |
p.openElements.pop(); | |
p.insertionMode = IN_TABLE_MODE; | |
p._processToken(token); | |
} | |
} | |
else if (tn !== $.BODY && tn !== $.CAPTION && tn !== $.COL && tn !== $.COLGROUP || | |
tn !== $.HTML && tn !== $.TD && tn !== $.TH && tn !== $.TR) | |
endTagInTable(p, token); | |
} | |
//12.2.5.4.14 The "in row" insertion mode | |
//------------------------------------------------------------------ | |
function startTagInRow(p, token) { | |
var tn = token.tagName; | |
if (tn === $.TH || tn === $.TD) { | |
p.openElements.clearBackToTableRowContext(); | |
p._insertElement(token, NS.HTML); | |
p.insertionMode = IN_CELL_MODE; | |
p.activeFormattingElements.insertMarker(); | |
} | |
else if (tn === $.CAPTION || tn === $.COL || tn === $.COLGROUP || tn === $.TBODY || | |
tn === $.TFOOT || tn === $.THEAD || tn === $.TR) { | |
if (p.openElements.hasInTableScope($.TR)) { | |
p.openElements.clearBackToTableRowContext(); | |
p.openElements.pop(); | |
p.insertionMode = IN_TABLE_BODY_MODE; | |
p._processToken(token); | |
} | |
} | |
else | |
startTagInTable(p, token); | |
} | |
function endTagInRow(p, token) { | |
var tn = token.tagName; | |
if (tn === $.TR) { | |
if (p.openElements.hasInTableScope($.TR)) { | |
p.openElements.clearBackToTableRowContext(); | |
p.openElements.pop(); | |
p.insertionMode = IN_TABLE_BODY_MODE; | |
} | |
} | |
else if (tn === $.TABLE) { | |
if (p.openElements.hasInTableScope($.TR)) { | |
p.openElements.clearBackToTableRowContext(); | |
p.openElements.pop(); | |
p.insertionMode = IN_TABLE_BODY_MODE; | |
p._processToken(token); | |
} | |
} | |
else if (tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD) { | |
if (p.openElements.hasInTableScope(tn) || p.openElements.hasInTableScope($.TR)) { | |
p.openElements.clearBackToTableRowContext(); | |
p.openElements.pop(); | |
p.insertionMode = IN_TABLE_BODY_MODE; | |
p._processToken(token); | |
} | |
} | |
else if (tn !== $.BODY && tn !== $.CAPTION && tn !== $.COL && tn !== $.COLGROUP || | |
tn !== $.HTML && tn !== $.TD && tn !== $.TH) | |
endTagInTable(p, token); | |
} | |
//12.2.5.4.15 The "in cell" insertion mode | |
//------------------------------------------------------------------ | |
function startTagInCell(p, token) { | |
var tn = token.tagName; | |
if (tn === $.CAPTION || tn === $.COL || tn === $.COLGROUP || tn === $.TBODY || | |
tn === $.TD || tn === $.TFOOT || tn === $.TH || tn === $.THEAD || tn === $.TR) { | |
if (p.openElements.hasInTableScope($.TD) || p.openElements.hasInTableScope($.TH)) { | |
p._closeTableCell(); | |
p._processToken(token); | |
} | |
} | |
else | |
startTagInBody(p, token); | |
} | |
function endTagInCell(p, token) { | |
var tn = token.tagName; | |
if (tn === $.TD || tn === $.TH) { | |
if (p.openElements.hasInTableScope(tn)) { | |
p.openElements.generateImpliedEndTags(); | |
p.openElements.popUntilTagNamePopped(tn); | |
p.activeFormattingElements.clearToLastMarker(); | |
p.insertionMode = IN_ROW_MODE; | |
} | |
} | |
else if (tn === $.TABLE || tn === $.TBODY || tn === $.TFOOT || tn === $.THEAD || tn === $.TR) { | |
if (p.openElements.hasInTableScope(tn)) { | |
p._closeTableCell(); | |
p._processToken(token); | |
} | |
} | |
else if (tn !== $.BODY && tn !== $.CAPTION && tn !== $.COL && tn !== $.COLGROUP && tn !== $.HTML) | |
endTagInBody(p, token); | |
} | |
//12.2.5.4.16 The "in select" insertion mode | |
//------------------------------------------------------------------ | |
function startTagInSelect(p, token) { | |
var tn = token.tagName; | |
if (tn === $.HTML) | |
startTagInBody(p, token); | |
else if (tn === $.OPTION) { | |
if (p.openElements.currentTagName === $.OPTION) | |
p.openElements.pop(); | |
p._insertElement(token, NS.HTML); | |
} | |
else if (tn === $.OPTGROUP) { | |
if (p.openElements.currentTagName === $.OPTION) | |
p.openElements.pop(); | |
if (p.openElements.currentTagName === $.OPTGROUP) | |
p.openElements.pop(); | |
p._insertElement(token, NS.HTML); | |
} | |
else if (tn === $.INPUT || tn === $.KEYGEN || tn === $.TEXTAREA || tn === $.SELECT) { | |
if (p.openElements.hasInSelectScope($.SELECT)) { | |
p.openElements.popUntilTagNamePopped($.SELECT); | |
p._resetInsertionMode(); | |
if (tn !== $.SELECT) | |
p._processToken(token); | |
} | |
} | |
else if (tn === $.SCRIPT || tn === $.TEMPLATE) | |
startTagInHead(p, token); | |
} | |
function endTagInSelect(p, token) { | |
var tn = token.tagName; | |
if (tn === $.OPTGROUP) { | |
var prevOpenElement = p.openElements.items[p.openElements.stackTop - 1], | |
prevOpenElementTn = prevOpenElement && p.treeAdapter.getTagName(prevOpenElement); | |
if (p.openElements.currentTagName === $.OPTION && prevOpenElementTn === $.OPTGROUP) | |
p.openElements.pop(); | |
if (p.openElements.currentTagName === $.OPTGROUP) | |
p.openElements.pop(); | |
} | |
else if (tn === $.OPTION) { | |
if (p.openElements.currentTagName === $.OPTION) | |
p.openElements.pop(); | |
} | |
else if (tn === $.SELECT && p.openElements.hasInSelectScope($.SELECT)) { | |
p.openElements.popUntilTagNamePopped($.SELECT); | |
p._resetInsertionMode(); | |
} | |
else if (tn === $.TEMPLATE) | |
endTagInHead(p, token); | |
} | |
//12.2.5.4.17 The "in select in table" insertion mode | |
//------------------------------------------------------------------ | |
function startTagInSelectInTable(p, token) { | |
var tn = token.tagName; | |
if (tn === $.CAPTION || tn === $.TABLE || tn === $.TBODY || tn === $.TFOOT || | |
tn === $.THEAD || tn === $.TR || tn === $.TD || tn === $.TH) { | |
p.openElements.popUntilTagNamePopped($.SELECT); | |
p._resetInsertionMode(); | |
p._processToken(token); | |
} | |
else | |
startTagInSelect(p, token); | |
} | |
function endTagInSelectInTable(p, token) { | |
var tn = token.tagName; | |
if (tn === $.CAPTION || tn === $.TABLE || tn === $.TBODY || tn === $.TFOOT || | |
tn === $.THEAD || tn === $.TR || tn === $.TD || tn === $.TH) { | |
if (p.openElements.hasInTableScope(tn)) { | |
p.openElements.popUntilTagNamePopped($.SELECT); | |
p._resetInsertionMode(); | |
p._processToken(token); | |
} | |
} | |
else | |
endTagInSelect(p, token); | |
} | |
//12.2.5.4.18 The "in template" insertion mode | |
//------------------------------------------------------------------ | |
function startTagInTemplate(p, token) { | |
var tn = token.tagName; | |
if (tn === $.BASE || tn === $.BASEFONT || tn === $.BGSOUND || tn === $.LINK || tn === $.META || | |
tn === $.NOFRAMES || tn === $.SCRIPT || tn === $.STYLE || tn === $.TEMPLATE || tn === $.TITLE) | |
startTagInHead(p, token); | |
else { | |
var newInsertionMode = TEMPLATE_INSERTION_MODE_SWITCH_MAP[tn] || IN_BODY_MODE; | |
p._popTmplInsertionMode(); | |
p._pushTmplInsertionMode(newInsertionMode); | |
p.insertionMode = newInsertionMode; | |
p._processToken(token); | |
} | |
} | |
function endTagInTemplate(p, token) { | |
if (token.tagName === $.TEMPLATE) | |
endTagInHead(p, token); | |
} | |
function eofInTemplate(p, token) { | |
if (p.openElements.tmplCount > 0) { | |
p.openElements.popUntilTagNamePopped($.TEMPLATE); | |
p.activeFormattingElements.clearToLastMarker(); | |
p._popTmplInsertionMode(); | |
p._resetInsertionMode(); | |
p._processToken(token); | |
} | |
else | |
p.stopped = true; | |
} | |
//12.2.5.4.19 The "after body" insertion mode | |
//------------------------------------------------------------------ | |
function startTagAfterBody(p, token) { | |
if (token.tagName === $.HTML) | |
startTagInBody(p, token); | |
else | |
tokenAfterBody(p, token); | |
} | |
function endTagAfterBody(p, token) { | |
if (token.tagName === $.HTML) { | |
if (!p.fragmentContext) | |
p.insertionMode = AFTER_AFTER_BODY_MODE; | |
} | |
else | |
tokenAfterBody(p, token); | |
} | |
function tokenAfterBody(p, token) { | |
p.insertionMode = IN_BODY_MODE; | |
p._processToken(token); | |
} | |
//12.2.5.4.20 The "in frameset" insertion mode | |
//------------------------------------------------------------------ | |
function startTagInFrameset(p, token) { | |
var tn = token.tagName; | |
if (tn === $.HTML) | |
startTagInBody(p, token); | |
else if (tn === $.FRAMESET) | |
p._insertElement(token, NS.HTML); | |
else if (tn === $.FRAME) | |
p._appendElement(token, NS.HTML); | |
else if (tn === $.NOFRAMES) | |
startTagInHead(p, token); | |
} | |
function endTagInFrameset(p, token) { | |
if (token.tagName === $.FRAMESET && !p.openElements.isRootHtmlElementCurrent()) { | |
p.openElements.pop(); | |
if (!p.fragmentContext && p.openElements.currentTagName !== $.FRAMESET) | |
p.insertionMode = AFTER_FRAMESET_MODE; | |
} | |
} | |
//12.2.5.4.21 The "after frameset" insertion mode | |
//------------------------------------------------------------------ | |
function startTagAfterFrameset(p, token) { | |
var tn = token.tagName; | |
if (tn === $.HTML) | |
startTagInBody(p, token); | |
else if (tn === $.NOFRAMES) | |
startTagInHead(p, token); | |
} | |
function endTagAfterFrameset(p, token) { | |
if (token.tagName === $.HTML) | |
p.insertionMode = AFTER_AFTER_FRAMESET_MODE; | |
} | |
//12.2.5.4.22 The "after after body" insertion mode | |
//------------------------------------------------------------------ | |
function startTagAfterAfterBody(p, token) { | |
if (token.tagName === $.HTML) | |
startTagInBody(p, token); | |
else | |
tokenAfterAfterBody(p, token); | |
} | |
function tokenAfterAfterBody(p, token) { | |
p.insertionMode = IN_BODY_MODE; | |
p._processToken(token); | |
} | |
//12.2.5.4.23 The "after after frameset" insertion mode | |
//------------------------------------------------------------------ | |
function startTagAfterAfterFrameset(p, token) { | |
var tn = token.tagName; | |
if (tn === $.HTML) | |
startTagInBody(p, token); | |
else if (tn === $.NOFRAMES) | |
startTagInHead(p, token); | |
} | |
//12.2.5.5 The rules for parsing tokens in foreign content | |
//------------------------------------------------------------------ | |
function nullCharacterInForeignContent(p, token) { | |
token.chars = UNICODE.REPLACEMENT_CHARACTER; | |
p._insertCharacters(token); | |
} | |
function characterInForeignContent(p, token) { | |
p._insertCharacters(token); | |
p.framesetOk = false; | |
} | |
function startTagInForeignContent(p, token) { | |
if (foreignContent.causesExit(token) && !p.fragmentContext) { | |
while (p.treeAdapter.getNamespaceURI(p.openElements.current) !== NS.HTML && !p._isIntegrationPoint(p.openElements.current)) | |
p.openElements.pop(); | |
p._processToken(token); | |
} | |
else { | |
var current = p._getAdjustedCurrentElement(), | |
currentNs = p.treeAdapter.getNamespaceURI(current); | |
if (currentNs === NS.MATHML) | |
foreignContent.adjustTokenMathMLAttrs(token); | |
else if (currentNs === NS.SVG) { | |
foreignContent.adjustTokenSVGTagName(token); | |
foreignContent.adjustTokenSVGAttrs(token); | |
} | |
foreignContent.adjustTokenXMLAttrs(token); | |
if (token.selfClosing) | |
p._appendElement(token, currentNs); | |
else | |
p._insertElement(token, currentNs); | |
} | |
} | |
function endTagInForeignContent(p, token) { | |
for (var i = p.openElements.stackTop; i > 0; i--) { | |
var element = p.openElements.items[i]; | |
if (p.treeAdapter.getNamespaceURI(element) === NS.HTML) { | |
p._processToken(token); | |
break; | |
} | |
if (p.treeAdapter.getTagName(element).toLowerCase() === token.tagName) { | |
p.openElements.popUntilElementPopped(element); | |
break; | |
} | |
} | |
} | |
},{"../common/doctype":32,"../common/foreign_content":33,"../common/html":34,"../common/merge_options":35,"../common/unicode":36,"../location_info/parser_mixin":37,"../tokenizer":42,"../tree_adapters/default":45,"./formatting_element_list":39,"./open_element_stack":41}],41:[function(require,module,exports){ | |
'use strict'; | |
var HTML = require('../common/html'); | |
//Aliases | |
var $ = HTML.TAG_NAMES, | |
NS = HTML.NAMESPACES; | |
//Element utils | |
//OPTIMIZATION: Integer comparisons are low-cost, so we can use very fast tag name length filters here. | |
//It's faster than using dictionary. | |
function isImpliedEndTagRequired(tn) { | |
switch (tn.length) { | |
case 1: | |
return tn === $.P; | |
case 2: | |
return tn === $.RB || tn === $.RP || tn === $.RT || tn === $.DD || tn === $.DT || tn === $.LI; | |
case 3: | |
return tn === $.RTC; | |
case 6: | |
return tn === $.OPTION; | |
case 8: | |
return tn === $.OPTGROUP || tn === $.MENUITEM; | |
} | |
return false; | |
} | |
function isScopingElement(tn, ns) { | |
switch (tn.length) { | |
case 2: | |
if (tn === $.TD || tn === $.TH) | |
return ns === NS.HTML; | |
else if (tn === $.MI || tn === $.MO || tn === $.MN || tn === $.MS) | |
return ns === NS.MATHML; | |
break; | |
case 4: | |
if (tn === $.HTML) | |
return ns === NS.HTML; | |
else if (tn === $.DESC) | |
return ns === NS.SVG; | |
break; | |
case 5: | |
if (tn === $.TABLE) | |
return ns === NS.HTML; | |
else if (tn === $.MTEXT) | |
return ns === NS.MATHML; | |
else if (tn === $.TITLE) | |
return ns === NS.SVG; | |
break; | |
case 6: | |
return (tn === $.APPLET || tn === $.OBJECT) && ns === NS.HTML; | |
case 7: | |
return (tn === $.CAPTION || tn === $.MARQUEE) && ns === NS.HTML; | |
case 8: | |
return tn === $.TEMPLATE && ns === NS.HTML; | |
case 13: | |
return tn === $.FOREIGN_OBJECT && ns === NS.SVG; | |
case 14: | |
return tn === $.ANNOTATION_XML && ns === NS.MATHML; | |
} | |
return false; | |
} | |
//Stack of open elements | |
var OpenElementStack = module.exports = function (document, treeAdapter) { | |
this.stackTop = -1; | |
this.items = []; | |
this.current = document; | |
this.currentTagName = null; | |
this.currentTmplContent = null; | |
this.tmplCount = 0; | |
this.treeAdapter = treeAdapter; | |
}; | |
//Index of element | |
OpenElementStack.prototype._indexOf = function (element) { | |
var idx = -1; | |
for (var i = this.stackTop; i >= 0; i--) { | |
if (this.items[i] === element) { | |
idx = i; | |
break; | |
} | |
} | |
return idx; | |
}; | |
//Update current element | |
OpenElementStack.prototype._isInTemplate = function () { | |
return this.currentTagName === $.TEMPLATE && this.treeAdapter.getNamespaceURI(this.current) === NS.HTML; | |
}; | |
OpenElementStack.prototype._updateCurrentElement = function () { | |
this.current = this.items[this.stackTop]; | |
this.currentTagName = this.current && this.treeAdapter.getTagName(this.current); | |
this.currentTmplContent = this._isInTemplate() ? this.treeAdapter.getTemplateContent(this.current) : null; | |
}; | |
//Mutations | |
OpenElementStack.prototype.push = function (element) { | |
this.items[++this.stackTop] = element; | |
this._updateCurrentElement(); | |
if (this._isInTemplate()) | |
this.tmplCount++; | |
}; | |
OpenElementStack.prototype.pop = function () { | |
this.stackTop--; | |
if (this.tmplCount > 0 && this._isInTemplate()) | |
this.tmplCount--; | |
this._updateCurrentElement(); | |
}; | |
OpenElementStack.prototype.replace = function (oldElement, newElement) { | |
var idx = this._indexOf(oldElement); | |
this.items[idx] = newElement; | |
if (idx === this.stackTop) | |
this._updateCurrentElement(); | |
}; | |
OpenElementStack.prototype.insertAfter = function (referenceElement, newElement) { | |
var insertionIdx = this._indexOf(referenceElement) + 1; | |
this.items.splice(insertionIdx, 0, newElement); | |
if (insertionIdx === ++this.stackTop) | |
this._updateCurrentElement(); | |
}; | |
OpenElementStack.prototype.popUntilTagNamePopped = function (tagName) { | |
while (this.stackTop > -1) { | |
var tn = this.currentTagName, | |
ns = this.treeAdapter.getNamespaceURI(this.current); | |
this.pop(); | |
if (tn === tagName && ns === NS.HTML) | |
break; | |
} | |
}; | |
OpenElementStack.prototype.popUntilElementPopped = function (element) { | |
while (this.stackTop > -1) { | |
var poppedElement = this.current; | |
this.pop(); | |
if (poppedElement === element) | |
break; | |
} | |
}; | |
OpenElementStack.prototype.popUntilNumberedHeaderPopped = function () { | |
while (this.stackTop > -1) { | |
var tn = this.currentTagName, | |
ns = this.treeAdapter.getNamespaceURI(this.current); | |
this.pop(); | |
if (tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6 && ns === NS.HTML) | |
break; | |
} | |
}; | |
OpenElementStack.prototype.popUntilTableCellPopped = function () { | |
while (this.stackTop > -1) { | |
var tn = this.currentTagName, | |
ns = this.treeAdapter.getNamespaceURI(this.current); | |
this.pop(); | |
if (tn === $.TD || tn === $.TH && ns === NS.HTML) | |
break; | |
} | |
}; | |
OpenElementStack.prototype.popAllUpToHtmlElement = function () { | |
//NOTE: here we assume that root <html> element is always first in the open element stack, so | |
//we perform this fast stack clean up. | |
this.stackTop = 0; | |
this._updateCurrentElement(); | |
}; | |
OpenElementStack.prototype.clearBackToTableContext = function () { | |
while (this.currentTagName !== $.TABLE && | |
this.currentTagName !== $.TEMPLATE && | |
this.currentTagName !== $.HTML || | |
this.treeAdapter.getNamespaceURI(this.current) !== NS.HTML) | |
this.pop(); | |
}; | |
OpenElementStack.prototype.clearBackToTableBodyContext = function () { | |
while (this.currentTagName !== $.TBODY && | |
this.currentTagName !== $.TFOOT && | |
this.currentTagName !== $.THEAD && | |
this.currentTagName !== $.TEMPLATE && | |
this.currentTagName !== $.HTML || | |
this.treeAdapter.getNamespaceURI(this.current) !== NS.HTML) | |
this.pop(); | |
}; | |
OpenElementStack.prototype.clearBackToTableRowContext = function () { | |
while (this.currentTagName !== $.TR && | |
this.currentTagName !== $.TEMPLATE && | |
this.currentTagName !== $.HTML || | |
this.treeAdapter.getNamespaceURI(this.current) !== NS.HTML) | |
this.pop(); | |
}; | |
OpenElementStack.prototype.remove = function (element) { | |
for (var i = this.stackTop; i >= 0; i--) { | |
if (this.items[i] === element) { | |
this.items.splice(i, 1); | |
this.stackTop--; | |
this._updateCurrentElement(); | |
break; | |
} | |
} | |
}; | |
//Search | |
OpenElementStack.prototype.tryPeekProperlyNestedBodyElement = function () { | |
//Properly nested <body> element (should be second element in stack). | |
var element = this.items[1]; | |
return element && this.treeAdapter.getTagName(element) === $.BODY ? element : null; | |
}; | |
OpenElementStack.prototype.contains = function (element) { | |
return this._indexOf(element) > -1; | |
}; | |
OpenElementStack.prototype.getCommonAncestor = function (element) { | |
var elementIdx = this._indexOf(element); | |
return --elementIdx >= 0 ? this.items[elementIdx] : null; | |
}; | |
OpenElementStack.prototype.isRootHtmlElementCurrent = function () { | |
return this.stackTop === 0 && this.currentTagName === $.HTML; | |
}; | |
//Element in scope | |
OpenElementStack.prototype.hasInScope = function (tagName) { | |
for (var i = this.stackTop; i >= 0; i--) { | |
var tn = this.treeAdapter.getTagName(this.items[i]), | |
ns = this.treeAdapter.getNamespaceURI(this.items[i]); | |
if (tn === tagName && ns === NS.HTML) | |
return true; | |
if (isScopingElement(tn, ns)) | |
return false; | |
} | |
return true; | |
}; | |
OpenElementStack.prototype.hasNumberedHeaderInScope = function () { | |
for (var i = this.stackTop; i >= 0; i--) { | |
var tn = this.treeAdapter.getTagName(this.items[i]), | |
ns = this.treeAdapter.getNamespaceURI(this.items[i]); | |
if ((tn === $.H1 || tn === $.H2 || tn === $.H3 || tn === $.H4 || tn === $.H5 || tn === $.H6) && ns === NS.HTML) | |
return true; | |
if (isScopingElement(tn, ns)) | |
return false; | |
} | |
return true; | |
}; | |
OpenElementStack.prototype.hasInListItemScope = function (tagName) { | |
for (var i = this.stackTop; i >= 0; i--) { | |
var tn = this.treeAdapter.getTagName(this.items[i]), | |
ns = this.treeAdapter.getNamespaceURI(this.items[i]); | |
if (tn === tagName && ns === NS.HTML) | |
return true; | |
if ((tn === $.UL || tn === $.OL) && ns === NS.HTML || isScopingElement(tn, ns)) | |
return false; | |
} | |
return true; | |
}; | |
OpenElementStack.prototype.hasInButtonScope = function (tagName) { | |
for (var i = this.stackTop; i >= 0; i--) { | |
var tn = this.treeAdapter.getTagName(this.items[i]), | |
ns = this.treeAdapter.getNamespaceURI(this.items[i]); | |
if (tn === tagName && ns === NS.HTML) | |
return true; | |
if (tn === $.BUTTON && ns === NS.HTML || isScopingElement(tn, ns)) | |
return false; | |
} | |
return true; | |
}; | |
OpenElementStack.prototype.hasInTableScope = function (tagName) { | |
for (var i = this.stackTop; i >= 0; i--) { | |
var tn = this.treeAdapter.getTagName(this.items[i]), | |
ns = this.treeAdapter.getNamespaceURI(this.items[i]); | |
if (ns !== NS.HTML) | |
continue; | |
if (tn === tagName) | |
return true; | |
if (tn === $.TABLE || tn === $.TEMPLATE || tn === $.HTML) | |
return false; | |
} | |
return true; | |
}; | |
OpenElementStack.prototype.hasTableBodyContextInTableScope = function () { | |
for (var i = this.stackTop; i >= 0; i--) { | |
var tn = this.treeAdapter.getTagName(this.items[i]), | |
ns = this.treeAdapter.getNamespaceURI(this.items[i]); | |
if (ns !== NS.HTML) | |
continue; | |
if (tn === $.TBODY || tn === $.THEAD || tn === $.TFOOT) | |
return true; | |
if (tn === $.TABLE || tn === $.HTML) | |
return false; | |
} | |
return true; | |
}; | |
OpenElementStack.prototype.hasInSelectScope = function (tagName) { | |
for (var i = this.stackTop; i >= 0; i--) { | |
var tn = this.treeAdapter.getTagName(this.items[i]), | |
ns = this.treeAdapter.getNamespaceURI(this.items[i]); | |
if (ns !== NS.HTML) | |
continue; | |
if (tn === tagName) | |
return true; | |
if (tn !== $.OPTION && tn !== $.OPTGROUP) | |
return false; | |
} | |
return true; | |
}; | |
//Implied end tags | |
OpenElementStack.prototype.generateImpliedEndTags = function () { | |
while (isImpliedEndTagRequired(this.currentTagName)) | |
this.pop(); | |
}; | |
OpenElementStack.prototype.generateImpliedEndTagsWithExclusion = function (exclusionTagName) { | |
while (isImpliedEndTagRequired(this.currentTagName) && this.currentTagName !== exclusionTagName) | |
this.pop(); | |
}; | |
},{"../common/html":34}],42:[function(require,module,exports){ | |
'use strict'; | |
var Preprocessor = require('./preprocessor'), | |
locationInfoMixin = require('../location_info/tokenizer_mixin'), | |
UNICODE = require('../common/unicode'), | |
neTree = require('./named_entity_data'); | |
//Aliases | |
var $ = UNICODE.CODE_POINTS, | |
$$ = UNICODE.CODE_POINT_SEQUENCES; | |
//Replacement code points for numeric entities | |
var NUMERIC_ENTITY_REPLACEMENTS = { | |
0x00: 0xFFFD, 0x0D: 0x000D, 0x80: 0x20AC, 0x81: 0x0081, 0x82: 0x201A, 0x83: 0x0192, 0x84: 0x201E, | |
0x85: 0x2026, 0x86: 0x2020, 0x87: 0x2021, 0x88: 0x02C6, 0x89: 0x2030, 0x8A: 0x0160, 0x8B: 0x2039, | |
0x8C: 0x0152, 0x8D: 0x008D, 0x8E: 0x017D, 0x8F: 0x008F, 0x90: 0x0090, 0x91: 0x2018, 0x92: 0x2019, | |
0x93: 0x201C, 0x94: 0x201D, 0x95: 0x2022, 0x96: 0x2013, 0x97: 0x2014, 0x98: 0x02DC, 0x99: 0x2122, | |
0x9A: 0x0161, 0x9B: 0x203A, 0x9C: 0x0153, 0x9D: 0x009D, 0x9E: 0x017E, 0x9F: 0x0178 | |
}; | |
// Named entity tree flags | |
var HAS_DATA_FLAG = 1 << 0; | |
var DATA_DUPLET_FLAG = 1 << 1; | |
var HAS_BRANCHES_FLAG = 1 << 2; | |
var MAX_BRANCH_MARKER_VALUE = HAS_DATA_FLAG | DATA_DUPLET_FLAG | HAS_BRANCHES_FLAG; | |
//States | |
var DATA_STATE = 'DATA_STATE', | |
CHARACTER_REFERENCE_IN_DATA_STATE = 'CHARACTER_REFERENCE_IN_DATA_STATE', | |
RCDATA_STATE = 'RCDATA_STATE', | |
CHARACTER_REFERENCE_IN_RCDATA_STATE = 'CHARACTER_REFERENCE_IN_RCDATA_STATE', | |
RAWTEXT_STATE = 'RAWTEXT_STATE', | |
SCRIPT_DATA_STATE = 'SCRIPT_DATA_STATE', | |
PLAINTEXT_STATE = 'PLAINTEXT_STATE', | |
TAG_OPEN_STATE = 'TAG_OPEN_STATE', | |
END_TAG_OPEN_STATE = 'END_TAG_OPEN_STATE', | |
TAG_NAME_STATE = 'TAG_NAME_STATE', | |
RCDATA_LESS_THAN_SIGN_STATE = 'RCDATA_LESS_THAN_SIGN_STATE', | |
RCDATA_END_TAG_OPEN_STATE = 'RCDATA_END_TAG_OPEN_STATE', | |
RCDATA_END_TAG_NAME_STATE = 'RCDATA_END_TAG_NAME_STATE', | |
RAWTEXT_LESS_THAN_SIGN_STATE = 'RAWTEXT_LESS_THAN_SIGN_STATE', | |
RAWTEXT_END_TAG_OPEN_STATE = 'RAWTEXT_END_TAG_OPEN_STATE', | |
RAWTEXT_END_TAG_NAME_STATE = 'RAWTEXT_END_TAG_NAME_STATE', | |
SCRIPT_DATA_LESS_THAN_SIGN_STATE = 'SCRIPT_DATA_LESS_THAN_SIGN_STATE', | |
SCRIPT_DATA_END_TAG_OPEN_STATE = 'SCRIPT_DATA_END_TAG_OPEN_STATE', | |
SCRIPT_DATA_END_TAG_NAME_STATE = 'SCRIPT_DATA_END_TAG_NAME_STATE', | |
SCRIPT_DATA_ESCAPE_START_STATE = 'SCRIPT_DATA_ESCAPE_START_STATE', | |
SCRIPT_DATA_ESCAPE_START_DASH_STATE = 'SCRIPT_DATA_ESCAPE_START_DASH_STATE', | |
SCRIPT_DATA_ESCAPED_STATE = 'SCRIPT_DATA_ESCAPED_STATE', | |
SCRIPT_DATA_ESCAPED_DASH_STATE = 'SCRIPT_DATA_ESCAPED_DASH_STATE', | |
SCRIPT_DATA_ESCAPED_DASH_DASH_STATE = 'SCRIPT_DATA_ESCAPED_DASH_DASH_STATE', | |
SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE = 'SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE', | |
SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE = 'SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE', | |
SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE = 'SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE', | |
SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE = 'SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE', | |
SCRIPT_DATA_DOUBLE_ESCAPED_STATE = 'SCRIPT_DATA_DOUBLE_ESCAPED_STATE', | |
SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE = 'SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE', | |
SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE = 'SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE', | |
SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE = 'SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE', | |
SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE = 'SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE', | |
BEFORE_ATTRIBUTE_NAME_STATE = 'BEFORE_ATTRIBUTE_NAME_STATE', | |
ATTRIBUTE_NAME_STATE = 'ATTRIBUTE_NAME_STATE', | |
AFTER_ATTRIBUTE_NAME_STATE = 'AFTER_ATTRIBUTE_NAME_STATE', | |
BEFORE_ATTRIBUTE_VALUE_STATE = 'BEFORE_ATTRIBUTE_VALUE_STATE', | |
ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE = 'ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE', | |
ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE = 'ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE', | |
ATTRIBUTE_VALUE_UNQUOTED_STATE = 'ATTRIBUTE_VALUE_UNQUOTED_STATE', | |
CHARACTER_REFERENCE_IN_ATTRIBUTE_VALUE_STATE = 'CHARACTER_REFERENCE_IN_ATTRIBUTE_VALUE_STATE', | |
AFTER_ATTRIBUTE_VALUE_QUOTED_STATE = 'AFTER_ATTRIBUTE_VALUE_QUOTED_STATE', | |
SELF_CLOSING_START_TAG_STATE = 'SELF_CLOSING_START_TAG_STATE', | |
BOGUS_COMMENT_STATE = 'BOGUS_COMMENT_STATE', | |
BOGUS_COMMENT_STATE_CONTINUATION = 'BOGUS_COMMENT_STATE_CONTINUATION', | |
MARKUP_DECLARATION_OPEN_STATE = 'MARKUP_DECLARATION_OPEN_STATE', | |
COMMENT_START_STATE = 'COMMENT_START_STATE', | |
COMMENT_START_DASH_STATE = 'COMMENT_START_DASH_STATE', | |
COMMENT_STATE = 'COMMENT_STATE', | |
COMMENT_END_DASH_STATE = 'COMMENT_END_DASH_STATE', | |
COMMENT_END_STATE = 'COMMENT_END_STATE', | |
COMMENT_END_BANG_STATE = 'COMMENT_END_BANG_STATE', | |
DOCTYPE_STATE = 'DOCTYPE_STATE', | |
DOCTYPE_NAME_STATE = 'DOCTYPE_NAME_STATE', | |
AFTER_DOCTYPE_NAME_STATE = 'AFTER_DOCTYPE_NAME_STATE', | |
BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE = 'BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE', | |
DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE = 'DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE', | |
DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE = 'DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE', | |
BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE = 'BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE', | |
BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE = 'BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE', | |
DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE = 'DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE', | |
DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE = 'DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE', | |
AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE = 'AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE', | |
BOGUS_DOCTYPE_STATE = 'BOGUS_DOCTYPE_STATE', | |
CDATA_SECTION_STATE = 'CDATA_SECTION_STATE'; | |
//Utils | |
//OPTIMIZATION: these utility functions should not be moved out of this module. V8 Crankshaft will not inline | |
//this functions if they will be situated in another module due to context switch. | |
//Always perform inlining check before modifying this functions ('node --trace-inlining'). | |
function isWhitespace(cp) { | |
return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED; | |
} | |
function isAsciiDigit(cp) { | |
return cp >= $.DIGIT_0 && cp <= $.DIGIT_9; | |
} | |
function isAsciiUpper(cp) { | |
return cp >= $.LATIN_CAPITAL_A && cp <= $.LATIN_CAPITAL_Z; | |
} | |
function isAsciiLower(cp) { | |
return cp >= $.LATIN_SMALL_A && cp <= $.LATIN_SMALL_Z; | |
} | |
function isAsciiLetter(cp) { | |
return isAsciiLower(cp) || isAsciiUpper(cp); | |
} | |
function isAsciiAlphaNumeric(cp) { | |
return isAsciiLetter(cp) || isAsciiDigit(cp); | |
} | |
function isDigit(cp, isHex) { | |
return isAsciiDigit(cp) || isHex && (cp >= $.LATIN_CAPITAL_A && cp <= $.LATIN_CAPITAL_F || | |
cp >= $.LATIN_SMALL_A && cp <= $.LATIN_SMALL_F); | |
} | |
function isReservedCodePoint(cp) { | |
return cp >= 0xD800 && cp <= 0xDFFF || cp > 0x10FFFF; | |
} | |
function toAsciiLowerCodePoint(cp) { | |
return cp + 0x0020; | |
} | |
//NOTE: String.fromCharCode() function can handle only characters from BMP subset. | |
//So, we need to workaround this manually. | |
//(see: https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/fromCharCode#Getting_it_to_work_with_higher_values) | |
function toChar(cp) { | |
if (cp <= 0xFFFF) | |
return String.fromCharCode(cp); | |
cp -= 0x10000; | |
return String.fromCharCode(cp >>> 10 & 0x3FF | 0xD800) + String.fromCharCode(0xDC00 | cp & 0x3FF); | |
} | |
function toAsciiLowerChar(cp) { | |
return String.fromCharCode(toAsciiLowerCodePoint(cp)); | |
} | |
function findNamedEntityTreeBranch(nodeIx, cp) { | |
var branchCount = neTree[++nodeIx], | |
lo = ++nodeIx, | |
hi = lo + branchCount - 1; | |
while (lo <= hi) { | |
var mid = lo + hi >>> 1, | |
midCp = neTree[mid]; | |
if (midCp < cp) | |
lo = mid + 1; | |
else if (midCp > cp) | |
hi = mid - 1; | |
else | |
return neTree[mid + branchCount]; | |
} | |
return -1; | |
} | |
//Tokenizer | |
var Tokenizer = module.exports = function (options) { | |
this.preprocessor = new Preprocessor(); | |
this.tokenQueue = []; | |
this.allowCDATA = false; | |
this.state = DATA_STATE; | |
this.returnState = ''; | |
this.tempBuff = []; | |
this.additionalAllowedCp = void 0; | |
this.lastStartTagName = ''; | |
this.consumedAfterSnapshot = -1; | |
this.active = false; | |
this.currentCharacterToken = null; | |
this.currentToken = null; | |
this.currentAttr = null; | |
if (options && options.locationInfo) | |
locationInfoMixin.assign(this); | |
}; | |
//Token types | |
Tokenizer.CHARACTER_TOKEN = 'CHARACTER_TOKEN'; | |
Tokenizer.NULL_CHARACTER_TOKEN = 'NULL_CHARACTER_TOKEN'; | |
Tokenizer.WHITESPACE_CHARACTER_TOKEN = 'WHITESPACE_CHARACTER_TOKEN'; | |
Tokenizer.START_TAG_TOKEN = 'START_TAG_TOKEN'; | |
Tokenizer.END_TAG_TOKEN = 'END_TAG_TOKEN'; | |
Tokenizer.COMMENT_TOKEN = 'COMMENT_TOKEN'; | |
Tokenizer.DOCTYPE_TOKEN = 'DOCTYPE_TOKEN'; | |
Tokenizer.EOF_TOKEN = 'EOF_TOKEN'; | |
Tokenizer.HIBERNATION_TOKEN = 'HIBERNATION_TOKEN'; | |
//Tokenizer initial states for different modes | |
Tokenizer.MODE = Tokenizer.prototype.MODE = { | |
DATA: DATA_STATE, | |
RCDATA: RCDATA_STATE, | |
RAWTEXT: RAWTEXT_STATE, | |
SCRIPT_DATA: SCRIPT_DATA_STATE, | |
PLAINTEXT: PLAINTEXT_STATE | |
}; | |
//Static | |
Tokenizer.getTokenAttr = function (token, attrName) { | |
for (var i = token.attrs.length - 1; i >= 0; i--) { | |
if (token.attrs[i].name === attrName) | |
return token.attrs[i].value; | |
} | |
return null; | |
}; | |
//API | |
Tokenizer.prototype.getNextToken = function () { | |
while (!this.tokenQueue.length && this.active) { | |
this._hibernationSnapshot(); | |
var cp = this._consume(); | |
if (!this._ensureHibernation()) | |
this[this.state](cp); | |
} | |
return this.tokenQueue.shift(); | |
}; | |
Tokenizer.prototype.write = function (chunk, isLastChunk) { | |
this.active = true; | |
this.preprocessor.write(chunk, isLastChunk); | |
}; | |
Tokenizer.prototype.insertHtmlAtCurrentPos = function (chunk) { | |
this.active = true; | |
this.preprocessor.insertHtmlAtCurrentPos(chunk); | |
}; | |
//Hibernation | |
Tokenizer.prototype._hibernationSnapshot = function () { | |
this.consumedAfterSnapshot = 0; | |
}; | |
Tokenizer.prototype._ensureHibernation = function () { | |
if (this.preprocessor.endOfChunkHit) { | |
for (; this.consumedAfterSnapshot > 0; this.consumedAfterSnapshot--) | |
this.preprocessor.retreat(); | |
this.active = false; | |
this.tokenQueue.push({type: Tokenizer.HIBERNATION_TOKEN}); | |
return true; | |
} | |
return false; | |
}; | |
//Consumption | |
Tokenizer.prototype._consume = function () { | |
this.consumedAfterSnapshot++; | |
return this.preprocessor.advance(); | |
}; | |
Tokenizer.prototype._unconsume = function () { | |
this.consumedAfterSnapshot--; | |
this.preprocessor.retreat(); | |
}; | |
Tokenizer.prototype._unconsumeSeveral = function (count) { | |
while (count--) | |
this._unconsume(); | |
}; | |
Tokenizer.prototype._reconsumeInState = function (state) { | |
this.state = state; | |
this._unconsume(); | |
}; | |
Tokenizer.prototype._consumeSubsequentIfMatch = function (pattern, startCp, caseSensitive) { | |
var consumedCount = 0, | |
isMatch = true, | |
patternLength = pattern.length, | |
patternPos = 0, | |
cp = startCp, | |
patternCp = void 0; | |
for (; patternPos < patternLength; patternPos++) { | |
if (patternPos > 0) { | |
cp = this._consume(); | |
consumedCount++; | |
} | |
if (cp === $.EOF) { | |
isMatch = false; | |
break; | |
} | |
patternCp = pattern[patternPos]; | |
if (cp !== patternCp && (caseSensitive || cp !== toAsciiLowerCodePoint(patternCp))) { | |
isMatch = false; | |
break; | |
} | |
} | |
if (!isMatch) | |
this._unconsumeSeveral(consumedCount); | |
return isMatch; | |
}; | |
//Lookahead | |
Tokenizer.prototype._lookahead = function () { | |
var cp = this._consume(); | |
this._unconsume(); | |
return cp; | |
}; | |
//Temp buffer | |
Tokenizer.prototype.isTempBufferEqualToScriptString = function () { | |
if (this.tempBuff.length !== $$.SCRIPT_STRING.length) | |
return false; | |
for (var i = 0; i < this.tempBuff.length; i++) { | |
if (this.tempBuff[i] !== $$.SCRIPT_STRING[i]) | |
return false; | |
} | |
return true; | |
}; | |
//Token creation | |
Tokenizer.prototype._createStartTagToken = function () { | |
this.currentToken = { | |
type: Tokenizer.START_TAG_TOKEN, | |
tagName: '', | |
selfClosing: false, | |
attrs: [] | |
}; | |
}; | |
Tokenizer.prototype._createEndTagToken = function () { | |
this.currentToken = { | |
type: Tokenizer.END_TAG_TOKEN, | |
tagName: '', | |
attrs: [] | |
}; | |
}; | |
Tokenizer.prototype._createCommentToken = function () { | |
this.currentToken = { | |
type: Tokenizer.COMMENT_TOKEN, | |
data: '' | |
}; | |
}; | |
Tokenizer.prototype._createDoctypeToken = function (initialName) { | |
this.currentToken = { | |
type: Tokenizer.DOCTYPE_TOKEN, | |
name: initialName, | |
forceQuirks: false, | |
publicId: null, | |
systemId: null | |
}; | |
}; | |
Tokenizer.prototype._createCharacterToken = function (type, ch) { | |
this.currentCharacterToken = { | |
type: type, | |
chars: ch | |
}; | |
}; | |
//Tag attributes | |
Tokenizer.prototype._createAttr = function (attrNameFirstCh) { | |
this.currentAttr = { | |
name: attrNameFirstCh, | |
value: '' | |
}; | |
}; | |
Tokenizer.prototype._isDuplicateAttr = function () { | |
return Tokenizer.getTokenAttr(this.currentToken, this.currentAttr.name) !== null; | |
}; | |
Tokenizer.prototype._leaveAttrName = function (toState) { | |
this.state = toState; | |
if (!this._isDuplicateAttr()) | |
this.currentToken.attrs.push(this.currentAttr); | |
}; | |
Tokenizer.prototype._leaveAttrValue = function (toState) { | |
this.state = toState; | |
}; | |
//Appropriate end tag token | |
//(see: http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#appropriate-end-tag-token) | |
Tokenizer.prototype._isAppropriateEndTagToken = function () { | |
return this.lastStartTagName === this.currentToken.tagName; | |
}; | |
//Token emission | |
Tokenizer.prototype._emitCurrentToken = function () { | |
this._emitCurrentCharacterToken(); | |
//NOTE: store emited start tag's tagName to determine is the following end tag token is appropriate. | |
if (this.currentToken.type === Tokenizer.START_TAG_TOKEN) | |
this.lastStartTagName = this.currentToken.tagName; | |
this.tokenQueue.push(this.currentToken); | |
this.currentToken = null; | |
}; | |
Tokenizer.prototype._emitCurrentCharacterToken = function () { | |
if (this.currentCharacterToken) { | |
this.tokenQueue.push(this.currentCharacterToken); | |
this.currentCharacterToken = null; | |
} | |
}; | |
Tokenizer.prototype._emitEOFToken = function () { | |
this._emitCurrentCharacterToken(); | |
this.tokenQueue.push({type: Tokenizer.EOF_TOKEN}); | |
}; | |
//Characters emission | |
//OPTIMIZATION: specification uses only one type of character tokens (one token per character). | |
//This causes a huge memory overhead and a lot of unnecessary parser loops. parse5 uses 3 groups of characters. | |
//If we have a sequence of characters that belong to the same group, parser can process it | |
//as a single solid character token. | |
//So, there are 3 types of character tokens in parse5: | |
//1)NULL_CHARACTER_TOKEN - \u0000-character sequences (e.g. '\u0000\u0000\u0000') | |
//2)WHITESPACE_CHARACTER_TOKEN - any whitespace/new-line character sequences (e.g. '\n \r\t \f') | |
//3)CHARACTER_TOKEN - any character sequence which don't belong to groups 1 and 2 (e.g. 'abcdef1234@@#$%^') | |
Tokenizer.prototype._appendCharToCurrentCharacterToken = function (type, ch) { | |
if (this.currentCharacterToken && this.currentCharacterToken.type !== type) | |
this._emitCurrentCharacterToken(); | |
if (this.currentCharacterToken) | |
this.currentCharacterToken.chars += ch; | |
else | |
this._createCharacterToken(type, ch); | |
}; | |
Tokenizer.prototype._emitCodePoint = function (cp) { | |
var type = Tokenizer.CHARACTER_TOKEN; | |
if (isWhitespace(cp)) | |
type = Tokenizer.WHITESPACE_CHARACTER_TOKEN; | |
else if (cp === $.NULL) | |
type = Tokenizer.NULL_CHARACTER_TOKEN; | |
this._appendCharToCurrentCharacterToken(type, toChar(cp)); | |
}; | |
Tokenizer.prototype._emitSeveralCodePoints = function (codePoints) { | |
for (var i = 0; i < codePoints.length; i++) | |
this._emitCodePoint(codePoints[i]); | |
}; | |
//NOTE: used then we emit character explicitly. This is always a non-whitespace and a non-null character. | |
//So we can avoid additional checks here. | |
Tokenizer.prototype._emitChar = function (ch) { | |
this._appendCharToCurrentCharacterToken(Tokenizer.CHARACTER_TOKEN, ch); | |
}; | |
//Character reference tokenization | |
Tokenizer.prototype._consumeNumericEntity = function (isHex) { | |
var digits = '', | |
nextCp = void 0; | |
do { | |
digits += toChar(this._consume()); | |
nextCp = this._lookahead(); | |
} while (nextCp !== $.EOF && isDigit(nextCp, isHex)); | |
if (this._lookahead() === $.SEMICOLON) | |
this._consume(); | |
var referencedCp = parseInt(digits, isHex ? 16 : 10), | |
replacement = NUMERIC_ENTITY_REPLACEMENTS[referencedCp]; | |
if (replacement) | |
return replacement; | |
if (isReservedCodePoint(referencedCp)) | |
return $.REPLACEMENT_CHARACTER; | |
return referencedCp; | |
}; | |
// NOTE: for the details on this algorithm see | |
// https://github.com/inikulin/parse5/tree/master/scripts/generate_named_entity_data/README.md | |
Tokenizer.prototype._consumeNamedEntity = function (inAttr) { | |
var referencedCodePoints = null, | |
referenceSize = 0, | |
cp = null, | |
consumedCount = 0, | |
semicolonTerminated = false; | |
for (var i = 0; i > -1;) { | |
var current = neTree[i], | |
inNode = current < MAX_BRANCH_MARKER_VALUE, | |
nodeWithData = inNode && current & HAS_DATA_FLAG; | |
if (nodeWithData) { | |
referencedCodePoints = current & DATA_DUPLET_FLAG ? [neTree[++i], neTree[++i]] : [neTree[++i]]; | |
referenceSize = consumedCount; | |
if (cp === $.SEMICOLON) { | |
semicolonTerminated = true; | |
break; | |
} | |
} | |
cp = this._consume(); | |
consumedCount++; | |
if (cp === $.EOF) | |
break; | |
if (inNode) | |
i = current & HAS_BRANCHES_FLAG ? findNamedEntityTreeBranch(i, cp) : -1; | |
else | |
i = cp === current ? ++i : -1; | |
} | |
if (referencedCodePoints) { | |
if (!semicolonTerminated) { | |
//NOTE: unconsume excess (e.g. 'it' in '¬it') | |
this._unconsumeSeveral(consumedCount - referenceSize); | |
//NOTE: If the character reference is being consumed as part of an attribute and the next character | |
//is either a U+003D EQUALS SIGN character (=) or an alphanumeric ASCII character, then, for historical | |
//reasons, all the characters that were matched after the U+0026 AMPERSAND character (&) must be | |
//unconsumed, and nothing is returned. | |
//However, if this next character is in fact a U+003D EQUALS SIGN character (=), then this is a | |
//parse error, because some legacy user agents will misinterpret the markup in those cases. | |
//(see: http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#tokenizing-character-references) | |
if (inAttr) { | |
var nextCp = this._lookahead(); | |
if (nextCp === $.EQUALS_SIGN || isAsciiAlphaNumeric(nextCp)) { | |
this._unconsumeSeveral(referenceSize); | |
return null; | |
} | |
} | |
} | |
return referencedCodePoints; | |
} | |
this._unconsumeSeveral(consumedCount); | |
return null; | |
}; | |
Tokenizer.prototype._consumeCharacterReference = function (startCp, inAttr) { | |
if (isWhitespace(startCp) || startCp === $.GREATER_THAN_SIGN || | |
startCp === $.AMPERSAND || startCp === this.additionalAllowedCp || startCp === $.EOF) { | |
//NOTE: not a character reference. No characters are consumed, and nothing is returned. | |
this._unconsume(); | |
return null; | |
} | |
if (startCp === $.NUMBER_SIGN) { | |
//NOTE: we have a numeric entity candidate, now we should determine if it's hex or decimal | |
var isHex = false, | |
nextCp = this._lookahead(); | |
if (nextCp === $.LATIN_SMALL_X || nextCp === $.LATIN_CAPITAL_X) { | |
this._consume(); | |
isHex = true; | |
} | |
nextCp = this._lookahead(); | |
//NOTE: if we have at least one digit this is a numeric entity for sure, so we consume it | |
if (nextCp !== $.EOF && isDigit(nextCp, isHex)) | |
return [this._consumeNumericEntity(isHex)]; | |
//NOTE: otherwise this is a bogus number entity and a parse error. Unconsume the number sign | |
//and the 'x'-character if appropriate. | |
this._unconsumeSeveral(isHex ? 2 : 1); | |
return null; | |
} | |
this._unconsume(); | |
return this._consumeNamedEntity(inAttr); | |
}; | |
//State machine | |
var _ = Tokenizer.prototype; | |
//12.2.4.1 Data state | |
//------------------------------------------------------------------ | |
_[DATA_STATE] = function dataState(cp) { | |
this.preprocessor.dropParsedChunk(); | |
if (cp === $.AMPERSAND) | |
this.state = CHARACTER_REFERENCE_IN_DATA_STATE; | |
else if (cp === $.LESS_THAN_SIGN) | |
this.state = TAG_OPEN_STATE; | |
else if (cp === $.NULL) | |
this._emitCodePoint(cp); | |
else if (cp === $.EOF) | |
this._emitEOFToken(); | |
else | |
this._emitCodePoint(cp); | |
}; | |
//12.2.4.2 Character reference in data state | |
//------------------------------------------------------------------ | |
_[CHARACTER_REFERENCE_IN_DATA_STATE] = function characterReferenceInDataState(cp) { | |
this.additionalAllowedCp = void 0; | |
var referencedCodePoints = this._consumeCharacterReference(cp, false); | |
if (!this._ensureHibernation()) { | |
if (referencedCodePoints) | |
this._emitSeveralCodePoints(referencedCodePoints); | |
else | |
this._emitChar('&'); | |
this.state = DATA_STATE; | |
} | |
}; | |
//12.2.4.3 RCDATA state | |
//------------------------------------------------------------------ | |
_[RCDATA_STATE] = function rcdataState(cp) { | |
this.preprocessor.dropParsedChunk(); | |
if (cp === $.AMPERSAND) | |
this.state = CHARACTER_REFERENCE_IN_RCDATA_STATE; | |
else if (cp === $.LESS_THAN_SIGN) | |
this.state = RCDATA_LESS_THAN_SIGN_STATE; | |
else if (cp === $.NULL) | |
this._emitChar(UNICODE.REPLACEMENT_CHARACTER); | |
else if (cp === $.EOF) | |
this._emitEOFToken(); | |
else | |
this._emitCodePoint(cp); | |
}; | |
//12.2.4.4 Character reference in RCDATA state | |
//------------------------------------------------------------------ | |
_[CHARACTER_REFERENCE_IN_RCDATA_STATE] = function characterReferenceInRcdataState(cp) { | |
this.additionalAllowedCp = void 0; | |
var referencedCodePoints = this._consumeCharacterReference(cp, false); | |
if (!this._ensureHibernation()) { | |
if (referencedCodePoints) | |
this._emitSeveralCodePoints(referencedCodePoints); | |
else | |
this._emitChar('&'); | |
this.state = RCDATA_STATE; | |
} | |
}; | |
//12.2.4.5 RAWTEXT state | |
//------------------------------------------------------------------ | |
_[RAWTEXT_STATE] = function rawtextState(cp) { | |
this.preprocessor.dropParsedChunk(); | |
if (cp === $.LESS_THAN_SIGN) | |
this.state = RAWTEXT_LESS_THAN_SIGN_STATE; | |
else if (cp === $.NULL) | |
this._emitChar(UNICODE.REPLACEMENT_CHARACTER); | |
else if (cp === $.EOF) | |
this._emitEOFToken(); | |
else | |
this._emitCodePoint(cp); | |
}; | |
//12.2.4.6 Script data state | |
//------------------------------------------------------------------ | |
_[SCRIPT_DATA_STATE] = function scriptDataState(cp) { | |
this.preprocessor.dropParsedChunk(); | |
if (cp === $.LESS_THAN_SIGN) | |
this.state = SCRIPT_DATA_LESS_THAN_SIGN_STATE; | |
else if (cp === $.NULL) | |
this._emitChar(UNICODE.REPLACEMENT_CHARACTER); | |
else if (cp === $.EOF) | |
this._emitEOFToken(); | |
else | |
this._emitCodePoint(cp); | |
}; | |
//12.2.4.7 PLAINTEXT state | |
//------------------------------------------------------------------ | |
_[PLAINTEXT_STATE] = function plaintextState(cp) { | |
this.preprocessor.dropParsedChunk(); | |
if (cp === $.NULL) | |
this._emitChar(UNICODE.REPLACEMENT_CHARACTER); | |
else if (cp === $.EOF) | |
this._emitEOFToken(); | |
else | |
this._emitCodePoint(cp); | |
}; | |
//12.2.4.8 Tag open state | |
//------------------------------------------------------------------ | |
_[TAG_OPEN_STATE] = function tagOpenState(cp) { | |
if (cp === $.EXCLAMATION_MARK) | |
this.state = MARKUP_DECLARATION_OPEN_STATE; | |
else if (cp === $.SOLIDUS) | |
this.state = END_TAG_OPEN_STATE; | |
else if (isAsciiLetter(cp)) { | |
this._createStartTagToken(); | |
this._reconsumeInState(TAG_NAME_STATE); | |
} | |
else if (cp === $.QUESTION_MARK) | |
this._reconsumeInState(BOGUS_COMMENT_STATE); | |
else { | |
this._emitChar('<'); | |
this._reconsumeInState(DATA_STATE); | |
} | |
}; | |
//12.2.4.9 End tag open state | |
//------------------------------------------------------------------ | |
_[END_TAG_OPEN_STATE] = function endTagOpenState(cp) { | |
if (isAsciiLetter(cp)) { | |
this._createEndTagToken(); | |
this._reconsumeInState(TAG_NAME_STATE); | |
} | |
else if (cp === $.GREATER_THAN_SIGN) | |
this.state = DATA_STATE; | |
else if (cp === $.EOF) { | |
this._reconsumeInState(DATA_STATE); | |
this._emitChar('<'); | |
this._emitChar('/'); | |
} | |
else | |
this._reconsumeInState(BOGUS_COMMENT_STATE); | |
}; | |
//12.2.4.10 Tag name state | |
//------------------------------------------------------------------ | |
_[TAG_NAME_STATE] = function tagNameState(cp) { | |
if (isWhitespace(cp)) | |
this.state = BEFORE_ATTRIBUTE_NAME_STATE; | |
else if (cp === $.SOLIDUS) | |
this.state = SELF_CLOSING_START_TAG_STATE; | |
else if (cp === $.GREATER_THAN_SIGN) { | |
this.state = DATA_STATE; | |
this._emitCurrentToken(); | |
} | |
else if (isAsciiUpper(cp)) | |
this.currentToken.tagName += toAsciiLowerChar(cp); | |
else if (cp === $.NULL) | |
this.currentToken.tagName += UNICODE.REPLACEMENT_CHARACTER; | |
else if (cp === $.EOF) | |
this._reconsumeInState(DATA_STATE); | |
else | |
this.currentToken.tagName += toChar(cp); | |
}; | |
//12.2.4.11 RCDATA less-than sign state | |
//------------------------------------------------------------------ | |
_[RCDATA_LESS_THAN_SIGN_STATE] = function rcdataLessThanSignState(cp) { | |
if (cp === $.SOLIDUS) { | |
this.tempBuff = []; | |
this.state = RCDATA_END_TAG_OPEN_STATE; | |
} | |
else { | |
this._emitChar('<'); | |
this._reconsumeInState(RCDATA_STATE); | |
} | |
}; | |
//12.2.4.12 RCDATA end tag open state | |
//------------------------------------------------------------------ | |
_[RCDATA_END_TAG_OPEN_STATE] = function rcdataEndTagOpenState(cp) { | |
if (isAsciiLetter(cp)) { | |
this._createEndTagToken(); | |
this._reconsumeInState(RCDATA_END_TAG_NAME_STATE); | |
} | |
else { | |
this._emitChar('<'); | |
this._emitChar('/'); | |
this._reconsumeInState(RCDATA_STATE); | |
} | |
}; | |
//12.2.4.13 RCDATA end tag name state | |
//------------------------------------------------------------------ | |
_[RCDATA_END_TAG_NAME_STATE] = function rcdataEndTagNameState(cp) { | |
if (isAsciiUpper(cp)) { | |
this.currentToken.tagName += toAsciiLowerChar(cp); | |
this.tempBuff.push(cp); | |
} | |
else if (isAsciiLower(cp)) { | |
this.currentToken.tagName += toChar(cp); | |
this.tempBuff.push(cp); | |
} | |
else { | |
if (this._isAppropriateEndTagToken()) { | |
if (isWhitespace(cp)) { | |
this.state = BEFORE_ATTRIBUTE_NAME_STATE; | |
return; | |
} | |
if (cp === $.SOLIDUS) { | |
this.state = SELF_CLOSING_START_TAG_STATE; | |
return; | |
} | |
if (cp === $.GREATER_THAN_SIGN) { | |
this.state = DATA_STATE; | |
this._emitCurrentToken(); | |
return; | |
} | |
} | |
this._emitChar('<'); | |
this._emitChar('/'); | |
this._emitSeveralCodePoints(this.tempBuff); | |
this._reconsumeInState(RCDATA_STATE); | |
} | |
}; | |
//12.2.4.14 RAWTEXT less-than sign state | |
//------------------------------------------------------------------ | |
_[RAWTEXT_LESS_THAN_SIGN_STATE] = function rawtextLessThanSignState(cp) { | |
if (cp === $.SOLIDUS) { | |
this.tempBuff = []; | |
this.state = RAWTEXT_END_TAG_OPEN_STATE; | |
} | |
else { | |
this._emitChar('<'); | |
this._reconsumeInState(RAWTEXT_STATE); | |
} | |
}; | |
//12.2.4.15 RAWTEXT end tag open state | |
//------------------------------------------------------------------ | |
_[RAWTEXT_END_TAG_OPEN_STATE] = function rawtextEndTagOpenState(cp) { | |
if (isAsciiLetter(cp)) { | |
this._createEndTagToken(); | |
this._reconsumeInState(RAWTEXT_END_TAG_NAME_STATE); | |
} | |
else { | |
this._emitChar('<'); | |
this._emitChar('/'); | |
this._reconsumeInState(RAWTEXT_STATE); | |
} | |
}; | |
//12.2.4.16 RAWTEXT end tag name state | |
//------------------------------------------------------------------ | |
_[RAWTEXT_END_TAG_NAME_STATE] = function rawtextEndTagNameState(cp) { | |
if (isAsciiUpper(cp)) { | |
this.currentToken.tagName += toAsciiLowerChar(cp); | |
this.tempBuff.push(cp); | |
} | |
else if (isAsciiLower(cp)) { | |
this.currentToken.tagName += toChar(cp); | |
this.tempBuff.push(cp); | |
} | |
else { | |
if (this._isAppropriateEndTagToken()) { | |
if (isWhitespace(cp)) { | |
this.state = BEFORE_ATTRIBUTE_NAME_STATE; | |
return; | |
} | |
if (cp === $.SOLIDUS) { | |
this.state = SELF_CLOSING_START_TAG_STATE; | |
return; | |
} | |
if (cp === $.GREATER_THAN_SIGN) { | |
this._emitCurrentToken(); | |
this.state = DATA_STATE; | |
return; | |
} | |
} | |
this._emitChar('<'); | |
this._emitChar('/'); | |
this._emitSeveralCodePoints(this.tempBuff); | |
this._reconsumeInState(RAWTEXT_STATE); | |
} | |
}; | |
//12.2.4.17 Script data less-than sign state | |
//------------------------------------------------------------------ | |
_[SCRIPT_DATA_LESS_THAN_SIGN_STATE] = function scriptDataLessThanSignState(cp) { | |
if (cp === $.SOLIDUS) { | |
this.tempBuff = []; | |
this.state = SCRIPT_DATA_END_TAG_OPEN_STATE; | |
} | |
else if (cp === $.EXCLAMATION_MARK) { | |
this.state = SCRIPT_DATA_ESCAPE_START_STATE; | |
this._emitChar('<'); | |
this._emitChar('!'); | |
} | |
else { | |
this._emitChar('<'); | |
this._reconsumeInState(SCRIPT_DATA_STATE); | |
} | |
}; | |
//12.2.4.18 Script data end tag open state | |
//------------------------------------------------------------------ | |
_[SCRIPT_DATA_END_TAG_OPEN_STATE] = function scriptDataEndTagOpenState(cp) { | |
if (isAsciiLetter(cp)) { | |
this._createEndTagToken(); | |
this._reconsumeInState(SCRIPT_DATA_END_TAG_NAME_STATE); | |
} | |
else { | |
this._emitChar('<'); | |
this._emitChar('/'); | |
this._reconsumeInState(SCRIPT_DATA_STATE); | |
} | |
}; | |
//12.2.4.19 Script data end tag name state | |
//------------------------------------------------------------------ | |
_[SCRIPT_DATA_END_TAG_NAME_STATE] = function scriptDataEndTagNameState(cp) { | |
if (isAsciiUpper(cp)) { | |
this.currentToken.tagName += toAsciiLowerChar(cp); | |
this.tempBuff.push(cp); | |
} | |
else if (isAsciiLower(cp)) { | |
this.currentToken.tagName += toChar(cp); | |
this.tempBuff.push(cp); | |
} | |
else { | |
if (this._isAppropriateEndTagToken()) { | |
if (isWhitespace(cp)) { | |
this.state = BEFORE_ATTRIBUTE_NAME_STATE; | |
return; | |
} | |
else if (cp === $.SOLIDUS) { | |
this.state = SELF_CLOSING_START_TAG_STATE; | |
return; | |
} | |
else if (cp === $.GREATER_THAN_SIGN) { | |
this._emitCurrentToken(); | |
this.state = DATA_STATE; | |
return; | |
} | |
} | |
this._emitChar('<'); | |
this._emitChar('/'); | |
this._emitSeveralCodePoints(this.tempBuff); | |
this._reconsumeInState(SCRIPT_DATA_STATE); | |
} | |
}; | |
//12.2.4.20 Script data escape start state | |
//------------------------------------------------------------------ | |
_[SCRIPT_DATA_ESCAPE_START_STATE] = function scriptDataEscapeStartState(cp) { | |
if (cp === $.HYPHEN_MINUS) { | |
this.state = SCRIPT_DATA_ESCAPE_START_DASH_STATE; | |
this._emitChar('-'); | |
} | |
else | |
this._reconsumeInState(SCRIPT_DATA_STATE); | |
}; | |
//12.2.4.21 Script data escape start dash state | |
//------------------------------------------------------------------ | |
_[SCRIPT_DATA_ESCAPE_START_DASH_STATE] = function scriptDataEscapeStartDashState(cp) { | |
if (cp === $.HYPHEN_MINUS) { | |
this.state = SCRIPT_DATA_ESCAPED_DASH_DASH_STATE; | |
this._emitChar('-'); | |
} | |
else | |
this._reconsumeInState(SCRIPT_DATA_STATE); | |
}; | |
//12.2.4.22 Script data escaped state | |
//------------------------------------------------------------------ | |
_[SCRIPT_DATA_ESCAPED_STATE] = function scriptDataEscapedState(cp) { | |
if (cp === $.HYPHEN_MINUS) { | |
this.state = SCRIPT_DATA_ESCAPED_DASH_STATE; | |
this._emitChar('-'); | |
} | |
else if (cp === $.LESS_THAN_SIGN) | |
this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE; | |
else if (cp === $.NULL) | |
this._emitChar(UNICODE.REPLACEMENT_CHARACTER); | |
else if (cp === $.EOF) | |
this._reconsumeInState(DATA_STATE); | |
else | |
this._emitCodePoint(cp); | |
}; | |
//12.2.4.23 Script data escaped dash state | |
//------------------------------------------------------------------ | |
_[SCRIPT_DATA_ESCAPED_DASH_STATE] = function scriptDataEscapedDashState(cp) { | |
if (cp === $.HYPHEN_MINUS) { | |
this.state = SCRIPT_DATA_ESCAPED_DASH_DASH_STATE; | |
this._emitChar('-'); | |
} | |
else if (cp === $.LESS_THAN_SIGN) | |
this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE; | |
else if (cp === $.NULL) { | |
this.state = SCRIPT_DATA_ESCAPED_STATE; | |
this._emitChar(UNICODE.REPLACEMENT_CHARACTER); | |
} | |
else if (cp === $.EOF) | |
this._reconsumeInState(DATA_STATE); | |
else { | |
this.state = SCRIPT_DATA_ESCAPED_STATE; | |
this._emitCodePoint(cp); | |
} | |
}; | |
//12.2.4.24 Script data escaped dash dash state | |
//------------------------------------------------------------------ | |
_[SCRIPT_DATA_ESCAPED_DASH_DASH_STATE] = function scriptDataEscapedDashDashState(cp) { | |
if (cp === $.HYPHEN_MINUS) | |
this._emitChar('-'); | |
else if (cp === $.LESS_THAN_SIGN) | |
this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE; | |
else if (cp === $.GREATER_THAN_SIGN) { | |
this.state = SCRIPT_DATA_STATE; | |
this._emitChar('>'); | |
} | |
else if (cp === $.NULL) { | |
this.state = SCRIPT_DATA_ESCAPED_STATE; | |
this._emitChar(UNICODE.REPLACEMENT_CHARACTER); | |
} | |
else if (cp === $.EOF) | |
this._reconsumeInState(DATA_STATE); | |
else { | |
this.state = SCRIPT_DATA_ESCAPED_STATE; | |
this._emitCodePoint(cp); | |
} | |
}; | |
//12.2.4.25 Script data escaped less-than sign state | |
//------------------------------------------------------------------ | |
_[SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE] = function scriptDataEscapedLessThanSignState(cp) { | |
if (cp === $.SOLIDUS) { | |
this.tempBuff = []; | |
this.state = SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE; | |
} | |
else if (isAsciiLetter(cp)) { | |
this.tempBuff = []; | |
this._emitChar('<'); | |
this._reconsumeInState(SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE); | |
} | |
else { | |
this._emitChar('<'); | |
this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE); | |
} | |
}; | |
//12.2.4.26 Script data escaped end tag open state | |
//------------------------------------------------------------------ | |
_[SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE] = function scriptDataEscapedEndTagOpenState(cp) { | |
if (isAsciiLetter(cp)) { | |
this._createEndTagToken(); | |
this._reconsumeInState(SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE); | |
} | |
else { | |
this._emitChar('<'); | |
this._emitChar('/'); | |
this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE); | |
} | |
}; | |
//12.2.4.27 Script data escaped end tag name state | |
//------------------------------------------------------------------ | |
_[SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE] = function scriptDataEscapedEndTagNameState(cp) { | |
if (isAsciiUpper(cp)) { | |
this.currentToken.tagName += toAsciiLowerChar(cp); | |
this.tempBuff.push(cp); | |
} | |
else if (isAsciiLower(cp)) { | |
this.currentToken.tagName += toChar(cp); | |
this.tempBuff.push(cp); | |
} | |
else { | |
if (this._isAppropriateEndTagToken()) { | |
if (isWhitespace(cp)) { | |
this.state = BEFORE_ATTRIBUTE_NAME_STATE; | |
return; | |
} | |
if (cp === $.SOLIDUS) { | |
this.state = SELF_CLOSING_START_TAG_STATE; | |
return; | |
} | |
if (cp === $.GREATER_THAN_SIGN) { | |
View raw
(Sorry about that, but we can’t show files that are this big right now.)
View raw
(Sorry about that, but we can’t show files that are this big right now.)
View raw
(Sorry about that, but we can’t show files that are this big right now.)
View raw
(Sorry about that, but we can’t show files that are this big right now.)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment