@los.dev/v-md-editor
Version:
A markdown editor built on Vue
1,702 lines (1,509 loc) • 295 kB
JavaScript
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("vue"));
else if(typeof define === 'function' && define.amd)
define("VMdEditor", ["vue"], factory);
else if(typeof exports === 'object')
exports["VMdEditor"] = factory(require("vue"));
else
root["VMdEditor"] = factory(root["Vue"]);
})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE__0__) {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 110);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE__0__;
/***/ }),
/* 1 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return bold; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return clear; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return code; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return fullscreen; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return h1; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return h2; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return h3; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return h4; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return h5; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return h6; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return hr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return image; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return italic; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return link; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return ol; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return quote; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return redo; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return strikethrough; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return syncScroll; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return table; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "u", function() { return ul; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "v", function() { return undo; });
var bold = 'bold';
var clear = 'clear';
var code = 'code';
var fullscreen = 'fullscreen';
var h1 = 'h1';
var h2 = 'h2';
var h3 = 'h3';
var h4 = 'h4';
var h5 = 'h5';
var h6 = 'h6';
var hr = 'hr';
var image = 'image';
var italic = 'italic';
var link = 'link';
var ol = 'ol';
var quote = 'quote';
var redo = 'redo';
var strikethrough = 'strikethrough';
var syncScroll = 'sync-scroll';
var table = 'table';
var ul = 'ul';
var undo = 'undo';
/***/ }),
/* 2 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return isObject; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return arraytoObject; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return importAll; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return inBrowser; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isKorean; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return generatorText; });
var toString = Object.prototype.toString;
var isObject = function isObject(target) {
return toString.call(target) === '[object Object]';
};
function extend(to, _from) {
Object.keys(_from).forEach(function (key) {
to[key] = _from[key];
});
return to;
}
function arraytoObject(arr) {
var res = {};
for (var i = 0; i < arr.length; i++) {
if (arr[i]) {
extend(res, arr[i]);
}
}
return res;
}
function importAll(map, r) {
r.keys().forEach(function (filePath) {
map[filePath] = r(filePath);
});
}
var inBrowser = typeof window !== 'undefined';
function isKorean(text) {
var reg = /([(\uAC00-\uD7AF)|(\u3130-\u318F)])+/gi;
return reg.test(text);
}
function generatorText(_ref) {
var selected = _ref.selected,
InsertGetter = _ref.InsertGetter,
_ref$selectedGetter = _ref.selectedGetter,
selectedGetter = _ref$selectedGetter === void 0 ? function (selected) {
return selected;
} : _ref$selectedGetter,
_ref$ignoreEmptyLine = _ref.ignoreEmptyLine,
ignoreEmptyLine = _ref$ignoreEmptyLine === void 0 ? true : _ref$ignoreEmptyLine;
var insertContent;
var newSelected;
if (selected) {
newSelected = selectedGetter(selected);
insertContent = InsertGetter(selected, 1); // 如果当前选中的文本包含换行 则插入后选中插入的所有文本
if (selected.indexOf('\n') !== -1) {
insertContent = selected.split('\n').map(function (rowText, index) {
var isEmptyLine = !rowText;
if (ignoreEmptyLine && isEmptyLine) return '';
return InsertGetter(rowText, index + 1).replace(selectedGetter(null), '');
}).join('\n');
newSelected = insertContent;
}
} else {
insertContent = InsertGetter(null, 1);
newSelected = selectedGetter(selected);
}
return {
insertContent: insertContent,
newSelected: newSelected
};
}
/***/ }),
/* 3 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return LINE_MARKUP; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return HEADING_MARKUP; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ANCHOR_MARKUP; });
var LINE_MARKUP = 'data-v-md-line';
var HEADING_MARKUP = 'data-v-md-heading';
var ANCHOR_MARKUP = 'data-v-md-anchor';
/***/ }),
/* 4 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony default export */ __webpack_exports__["a"] = ({
PREVIEW: 'preview',
EDITABLE: 'editable',
EDIT: 'edit'
});
/***/ }),
/* 5 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _extends; });
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
/***/ }),
/* 6 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getScrollTop; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return scrollTo; });
function getScrollTop(target) {
var result = 0;
if (target === window) {
result = target.pageYOffset;
} else if (target) {
result = target.scrollTop;
}
return result;
}
function scrollTo(target, scrollTop) {
if (target === window) {
window.scrollTo(window.pageYOffset, scrollTop);
} else if (target) {
target.scrollTop = scrollTop;
}
}
/***/ }),
/* 7 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
var esm_extends = __webpack_require__(5);
// EXTERNAL MODULE: ./node_modules/xss/lib/index.js
var lib = __webpack_require__(11);
var lib_default = /*#__PURE__*/__webpack_require__.n(lib);
// CONCATENATED MODULE: ./src/utils/xss/svg.js
/* harmony default export */ var svg = ({
svg: [],
altGlyph: [],
altGlyphDef: [],
altGlyphItem: [],
animate: [],
animateColor: [],
animateMotion: [],
animateTransform: [],
circle: [],
clipPath: [],
'color-profile': [],
cursor: [],
'definition-src': [],
defs: [],
desc: [],
ellipse: [],
feBlend: [],
feColorMatrix: [],
feComponentTransfer: [],
feComposite: [],
feConvolveMatrix: [],
feDiffuseLighting: [],
feDisplacementMap: [],
feDistantLight: [],
feFlood: [],
feFuncA: [],
feFuncB: [],
feFuncG: [],
feFuncR: [],
feGaussianBlur: [],
feImage: [],
feMerge: [],
feMergeNode: [],
feMorphology: [],
feOffset: [],
fePointLight: [],
feSpecularLighting: [],
feSpotLight: [],
feTile: [],
feTurbulence: [],
filter: [],
font: [],
foreignObject: [],
g: [],
glyph: [],
glyphRef: [],
hkern: [],
image: [],
line: [],
linearGradient: [],
marker: [],
mask: [],
metadata: [],
'missing-glyph': [],
mpath: [],
path: [],
pattern: [],
polygon: [],
polyline: [],
radialGradient: [],
rect: [],
set: [],
stop: [],
style: [],
switch: [],
symbol: [],
text: [],
textPath: [],
title: [],
tref: [],
tspan: [],
use: [],
view: [],
vkern: []
});
// CONCATENATED MODULE: ./src/utils/xss/KaTex.js
/* harmony default export */ var KaTex = ({
math: [],
annotation: [],
semantics: [],
mtext: [],
mn: [],
mo: [],
mi: [],
mspace: [],
mover: [],
munder: [],
munderover: [],
msup: [],
msub: [],
msubsup: [],
mfrac: [],
mroot: [],
msqrt: [],
mtable: [],
mtr: [],
mtd: [],
mlabeledtr: [],
mrow: [],
menclose: [],
mstyle: [],
mpadded: [],
mphantom: [],
mglyph: []
});
// CONCATENATED MODULE: ./src/utils/xss/common.js
var attrWhiteList = ['style', 'align', 'class', 'id'];
var prefixAttrWhiteList = ['data-'];
var tags = {
input: ['type'],
ol: ['reversed', 'start', 'type'],
button: ['type'],
summary: []
};
// CONCATENATED MODULE: ./src/utils/xss/index.js
var tagWhiteList = Object(esm_extends["a" /* default */])({}, tags, KaTex, svg);
var options = {
whiteList: Object(esm_extends["a" /* default */])({}, lib_default.a.getDefaultWhiteList(), tagWhiteList),
onIgnoreTagAttr: function onIgnoreTagAttr(tag, name, value) {
if (svg[tag] || KaTex[tag] || attrWhiteList.find(function (attr) {
return attr === name;
}) || prefixAttrWhiteList.find(function (prefix) {
return name.startsWith(prefix);
})) {
return name + "=\"" + lib_default.a.escapeAttrValue(value) + "\"";
}
}
};
var xssFilterInstance = new lib_default.a.FilterXSS(options);
xssFilterInstance.extend = function (extendOptions) {
var instanceOptions = xssFilterInstance.options;
Object.keys(extendOptions).forEach(function (optionName) {
// extend whiteList
if (optionName === 'whiteList') {
Object.keys(extendOptions.whiteList).forEach(function (tagName) {
var tagAttrWhiteList = extendOptions.whiteList[tagName];
var instanceWhiteList = instanceOptions.whiteList;
if (instanceWhiteList[tagName]) {
instanceWhiteList[tagName] = [].concat(instanceWhiteList[tagName], tagAttrWhiteList);
} else {
instanceWhiteList[tagName] = tagAttrWhiteList;
}
});
} else if (optionName === 'onIgnoreTagAttr') {
var oldHandler = instanceOptions.onIgnoreTagAttr;
instanceOptions.onIgnoreTagAttr = function () {
var _extendOptions$onIgno;
for (var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++) {
arg[_key] = arguments[_key];
}
var oldReturnVal = oldHandler.call.apply(oldHandler, [this].concat(arg));
var newReturnVal = (_extendOptions$onIgno = extendOptions.onIgnoreTagAttr).call.apply(_extendOptions$onIgno, [this].concat(arg));
return oldReturnVal || newReturnVal;
};
} else {
instanceOptions[optionName] = extendOptions[optionName];
}
});
};
/* harmony default export */ var xss = __webpack_exports__["a"] = (xssFilterInstance);
/***/ }),
/* 8 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return smooth; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return smoothScroll; });
/* harmony import */ var _scroll_top__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6);
function smooth(_ref) {
var currentScrollTop = _ref.currentScrollTop,
scrollToTop = _ref.scrollToTop,
scrollFn = _ref.scrollFn,
_ref$percent = _ref.percent,
percent = _ref$percent === void 0 ? 10 : _ref$percent,
onScrollEnd = _ref.onScrollEnd;
var scrollWay = scrollToTop > currentScrollTop ? 'down' : 'up';
var step = (scrollToTop - currentScrollTop) * (percent / 100);
var id;
var scroll = function scroll() {
currentScrollTop += step;
if (scrollWay === 'down' && currentScrollTop >= scrollToTop || scrollWay === 'up' && currentScrollTop <= scrollToTop) {
scrollFn(scrollToTop);
window.cancelAnimationFrame(id);
if (onScrollEnd) window.requestAnimationFrame(onScrollEnd);
} else {
scrollFn(currentScrollTop);
window.requestAnimationFrame(scroll);
}
};
window.requestAnimationFrame(scroll);
}
function smoothScroll(_ref2) {
var scrollTarget = _ref2.scrollTarget,
scrollToTop = _ref2.scrollToTop,
_ref2$percent = _ref2.percent,
percent = _ref2$percent === void 0 ? 10 : _ref2$percent,
onScrollEnd = _ref2.onScrollEnd;
var currentScrollTop = Object(_scroll_top__WEBPACK_IMPORTED_MODULE_0__[/* getScrollTop */ "a"])(scrollTarget);
smooth({
currentScrollTop: currentScrollTop,
scrollToTop: scrollToTop,
scrollFn: function scrollFn(scrollTop) {
return Object(_scroll_top__WEBPACK_IMPORTED_MODULE_0__[/* scrollTo */ "b"])(scrollTarget, scrollTop);
},
percent: percent,
onScrollEnd: onScrollEnd
});
}
/***/ }),
/* 9 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXTERNAL MODULE: external {"root":"Vue","commonjs":"vue","commonjs2":"vue","amd":"vue"}
var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_ = __webpack_require__(0);
// CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--3!./node_modules/vue-loader/dist/templateLoader.js??ref--6!./node_modules/vue-loader/dist??ref--2-0!./src/preview.vue?vue&type=template&id=2d66424c&bindings={}
function render(_ctx, _cache, $props, $setup, $data, $options) {
return Object(external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_["openBlock"])(), Object(external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_["createBlock"])("div", {
class: "v-md-editor-preview",
style: {
tabSize: _ctx.tabSize,
'-moz-tab-size': _ctx.tabSize,
'-o-tab-size': _ctx.tabSize
},
onClick: _cache[1] || (_cache[1] = function () {
return _ctx.handlePreviewClick.apply(_ctx, arguments);
})
}, [Object(external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_["createVNode"])("div", {
class: [_ctx.previewClass],
innerHTML: _ctx.html
}, null, 10
/* CLASS, PROPS */
, ["innerHTML"])], 4
/* STYLE */
);
}
// CONCATENATED MODULE: ./src/preview.vue?vue&type=template&id=2d66424c&bindings={}
// EXTERNAL MODULE: ./src/utils/xss/index.js + 3 modules
var xss = __webpack_require__(7);
// EXTERNAL MODULE: ./src/utils/lang.js + 1 modules
var lang = __webpack_require__(13);
// CONCATENATED MODULE: ./src/utils/v-md-parser.js
var v_md_parser_VMdParser = /*#__PURE__*/function () {
function VMdParser() {
this.lang = new lang["a" /* default */]();
}
var _proto = VMdParser.prototype;
_proto.defaultMarkdownLoader = function defaultMarkdownLoader(text) {
return text;
};
_proto.use = function use(optionsOrInstall, opt) {
if (typeof optionsOrInstall === 'function') {
optionsOrInstall(this, opt);
} else {
optionsOrInstall.install(this, opt);
}
return this;
};
_proto.theme = function theme(themeConfig) {
this.themeConfig = themeConfig;
};
_proto.extendMarkdown = function extendMarkdown(extender) {
if (!this.themeConfig) {
return console.error('Please use theme before using plugins');
}
var markdownParser = this.themeConfig.markdownParser;
extender(markdownParser);
};
_proto.parse = function parse(text) {
var _markdownParser$rende;
var markdownParser = this.themeConfig.markdownParser;
var markdownLoader = (markdownParser == null ? void 0 : (_markdownParser$rende = markdownParser.render) == null ? void 0 : _markdownParser$rende.bind(markdownParser)) || this.defaultMarkdownLoader;
if (typeof markdownLoader !== 'function' || markdownLoader === this.defaultMarkdownLoader) {
console.error('Please configure your markdown parser');
}
return markdownLoader(text);
};
return VMdParser;
}();
// EXTERNAL MODULE: ./src/mixins/preview.js
var preview = __webpack_require__(16);
// CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--3!./node_modules/vue-loader/dist??ref--2-0!./src/preview.vue?vue&type=script&lang=js
// mixins
var component = {
name: 'v-md-preview',
mixins: [preview["a" /* default */]],
props: {
text: {
type: String,
default: ''
},
theme: Object,
beforeChange: Function
},
emits: ['change'],
data: function data() {
return {
html: ''
};
},
watch: {
text: function text() {
this.handleTextChange();
},
langConfig: function langConfig() {
this.handleTextChange();
}
},
computed: {
vMdParser: function vMdParser() {
return this.$options.vMdParser;
},
previewClass: function previewClass() {
return this.vMdParser.themeConfig.previewClass;
},
langConfig: function langConfig() {
return this.vMdParser.lang.langConfig;
}
},
created: function created() {
this.handleTextChange();
},
methods: {
handleTextChange: function handleTextChange() {
var _this = this;
var next = function next(text) {
_this.html = xss["a" /* default */].process(_this.$options.vMdParser.parse(text));
_this.$emit('change', text, _this.html);
};
if (this.beforeChange) {
this.beforeChange(this.text, next);
} else {
next(this.text);
}
}
}
};
var vMdParser = new v_md_parser_VMdParser();
vMdParser.lang.config = Object(external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_["reactive"])(vMdParser.lang.config);
component.vMdParser = new v_md_parser_VMdParser();
/* harmony default export */ var previewvue_type_script_lang_js = (component);
// CONCATENATED MODULE: ./src/preview.vue?vue&type=script&lang=js
// CONCATENATED MODULE: ./src/preview.vue
previewvue_type_script_lang_js.render = render
/* harmony default export */ var src_preview = (previewvue_type_script_lang_js);
// EXTERNAL MODULE: ./src/assets/css/font.css
var font = __webpack_require__(18);
// CONCATENATED MODULE: ./src/preview.js
// This file is auto generated by build/build-entry.js
// font css
var version = '2.3.17';
var preview_install = function install(app) {
app.component(src_preview.name, src_preview);
};
src_preview.version = version;
src_preview.install = preview_install;
src_preview.xss = xss["a" /* default */];
src_preview.use = function (optionsOrInstall, opt) {
if (typeof optionsOrInstall === 'function') {
optionsOrInstall(src_preview, opt);
} else {
optionsOrInstall.install(src_preview, opt);
}
return src_preview;
};
/* harmony default export */ var src_preview_0 = __webpack_exports__["default"] = (src_preview);
/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {
// TODO(Babel 8): Remove this file.
var runtime = __webpack_require__(37)();
module.exports = runtime;
// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
try {
regeneratorRuntime = runtime;
} catch (accidentalStrictMode) {
if (typeof globalThis === "object") {
globalThis.regeneratorRuntime = runtime;
} else {
Function("r", "regeneratorRuntime = r")(runtime);
}
}
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
/**
* xss
*
* @author Zongmin Lei<leizongmin@gmail.com>
*/
var DEFAULT = __webpack_require__(19);
var parser = __webpack_require__(22);
var FilterXSS = __webpack_require__(26);
/**
* filter xss function
*
* @param {String} html
* @param {Object} options { whiteList, onTag, onTagAttr, onIgnoreTag, onIgnoreTagAttr, safeAttrValue, escapeHtml }
* @return {String}
*/
function filterXSS(html, options) {
var xss = new FilterXSS(options);
return xss.process(html);
}
exports = module.exports = filterXSS;
exports.filterXSS = filterXSS;
exports.FilterXSS = FilterXSS;
for (var i in DEFAULT) exports[i] = DEFAULT[i];
for (var i in parser) exports[i] = parser[i];
// using `xss` on the browser, output `filterXSS` to the globals
if (typeof window !== "undefined") {
window.filterXSS = module.exports;
}
// using `xss` on the WebWorker, output `filterXSS` to the globals
function isWorkerEnv() {
return (
typeof self !== "undefined" &&
typeof DedicatedWorkerGlobalScope !== "undefined" &&
self instanceof DedicatedWorkerGlobalScope
);
}
if (isWorkerEnv()) {
self.filterXSS = module.exports;
}
/***/ }),
/* 12 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return filesFilter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getFilesFromClipboardData; });
// Modified from https://github.com/ElemeFE/element/blob/dev/packages/upload/src/upload-dragger.vue
function filesFilter(files, config) {
var accept = config.accept;
var filesKeys = Object.keys(files).filter(function (key) {
var file = files[key];
var type = file.type,
name = file.name;
var extension = name.indexOf('.') > -1 ? "." + name.split('.').pop() : '';
var baseType = type.replace(/\/.*$/, '');
return accept.split(',').map(function (type) {
return type.trim();
}).filter(function (type) {
return type;
}).some(function (acceptedType) {
if (/\..+$/.test(acceptedType)) {
return extension === acceptedType;
}
if (/\/\*$/.test(acceptedType)) {
return baseType === acceptedType.replace(/\/\*$/, '');
} // eslint-disable-next-line no-useless-escape
if (/^[^\/]+\/[^\/]+$/.test(acceptedType)) {
return type === acceptedType;
}
return false;
});
});
return filesKeys.map(function (key) {
return files[key];
});
}
function getFilesFromClipboardData(clipboardData) {
var files = [];
Object.keys(clipboardData.items).forEach(function (key) {
var item = clipboardData.items[key];
if (item.kind === 'file') {
var file = item.getAsFile();
if (file) files.push(file);
}
});
return files;
}
/***/ }),
/* 13 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// EXPORTS
__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ lang_Lang; });
// EXTERNAL MODULE: ./src/utils/util.js
var util = __webpack_require__(2);
// CONCATENATED MODULE: ./src/utils/deep-assign.js
var deep_assign_hasOwnProperty = Object.prototype.hasOwnProperty;
function assignKey(to, from, key) {
var val = from[key];
if (val === undefined || val === null) {
return;
}
if (!deep_assign_hasOwnProperty.call(to, key) || !Object(util["f" /* isObject */])(val)) {
to[key] = val;
} else {
// eslint-disable-next-line
to[key] = deepAssign(Object(to[key]), from[key]);
}
}
function deepAssign(to, from) {
Object.keys(from).forEach(function (key) {
assignKey(to, from, key);
});
return to;
}
// CONCATENATED MODULE: ./src/utils/lang.js
var lang_Lang = /*#__PURE__*/function () {
function Lang(options) {
if (options === void 0) {
options = {};
}
this.config = {
lang: 'zh-CN',
langConfig: {
'zh-CN': {}
}
};
this.options = options;
}
var _proto = Lang.prototype;
_proto.use = function use(lang, config) {
var _this$add;
this.config.lang = lang;
this.add((_this$add = {}, _this$add[lang] = config, _this$add));
if (this.options.afterUse) this.options.afterUse(lang, config);
};
_proto.add = function add(config) {
if (config === void 0) {
config = {};
}
deepAssign(this.config.langConfig, config);
};
return Lang;
}();
/***/ }),
/* 14 */
/***/ (function(module, exports, __webpack_require__) {
/**
* cssfilter
*
* @author 老雷<leizongmin@gmail.com>
*/
var DEFAULT = __webpack_require__(20);
var FilterCSS = __webpack_require__(24);
/**
* XSS过滤
*
* @param {String} css 要过滤的CSS代码
* @param {Object} options 选项:whiteList, onAttr, onIgnoreAttr
* @return {String}
*/
function filterCSS (html, options) {
var xss = new FilterCSS(options);
return xss.process(html);
}
// 输出
exports = module.exports = filterCSS;
exports.FilterCSS = FilterCSS;
for (var i in DEFAULT) exports[i] = DEFAULT[i];
// 在浏览器端使用
if (typeof window !== 'undefined') {
window.filterCSS = module.exports;
}
/***/ }),
/* 15 */
/***/ (function(module, exports) {
module.exports = {
indexOf: function (arr, item) {
var i, j;
if (Array.prototype.indexOf) {
return arr.indexOf(item);
}
for (i = 0, j = arr.length; i < j; i++) {
if (arr[i] === item) {
return i;
}
}
return -1;
},
forEach: function (arr, fn, scope) {
var i, j;
if (Array.prototype.forEach) {
return arr.forEach(fn, scope);
}
for (i = 0, j = arr.length; i < j; i++) {
fn.call(scope, arr[i], i, arr);
}
},
trim: function (str) {
if (String.prototype.trim) {
return str.trim();
}
return str.replace(/(^\s*)|(\s*$)/g, "");
},
spaceIndex: function (str) {
var reg = /\s|\n|\t/;
var match = reg.exec(str);
return match ? match.index : -1;
},
};
/***/ }),
/* 16 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var _utils_scroll_top__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6);
/* harmony import */ var _utils_smooth_scroll__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8);
/* harmony import */ var _utils_constants_markup__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3);
/* harmony default export */ __webpack_exports__["a"] = ({
props: {
tabSize: {
type: Number,
default: 2
},
scrollContainer: {
type: Function,
default: function _default() {
return window;
}
},
top: {
type: Number,
default: 0
}
},
emits: ['image-click'],
methods: {
handlePreviewClick: function handlePreviewClick(e) {
var target = e.target; // image preview
if (target.tagName === 'IMG') {
var src = target.getAttribute('src');
if (!src) return;
var imageEls = Array.from(this.$el.querySelectorAll('img'));
var images = imageEls.map(function (el) {
return el.getAttribute('src');
}).filter(function (src) {
return src;
});
var imagePreviewInitIndex = imageEls.indexOf(target);
this.$emit('image-click', images, imagePreviewInitIndex);
return;
}
var scrollToTargetId = target.getAttribute(_utils_constants_markup__WEBPACK_IMPORTED_MODULE_2__[/* ANCHOR_MARKUP */ "a"]);
var scrollToTarget = this.$el.querySelector("[" + _utils_constants_markup__WEBPACK_IMPORTED_MODULE_2__[/* HEADING_MARKUP */ "b"] + "=\"" + scrollToTargetId + "\"]");
if (scrollToTarget) {
this.scrollToTarget({
target: scrollToTarget
});
}
},
getOffsetTop: function getOffsetTop(target, container) {
var rect = target.getBoundingClientRect();
if (container === window || container === document.documentElement) {
return rect.top;
}
return rect.top - container.getBoundingClientRect().top;
},
scrollToTarget: function scrollToTarget(_ref) {
var target = _ref.target,
_ref$scrollContainer = _ref.scrollContainer,
scrollContainer = _ref$scrollContainer === void 0 ? this.scrollContainer() : _ref$scrollContainer,
_ref$top = _ref.top,
top = _ref$top === void 0 ? this.top : _ref$top,
onScrollEnd = _ref.onScrollEnd;
var offsetTop = this.getOffsetTop(target, scrollContainer);
var scrollTop = Object(_utils_scroll_top__WEBPACK_IMPORTED_MODULE_0__[/* getScrollTop */ "a"])(scrollContainer) + offsetTop - top;
Object(_utils_smooth_scroll__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])({
scrollTarget: scrollContainer,
scrollToTop: scrollTop,
onScrollEnd: onScrollEnd
});
},
scrollToLine: function scrollToLine(_ref2) {
var lineIndex = _ref2.lineIndex,
onScrollEnd = _ref2.onScrollEnd;
if (lineIndex) {
var target = this.$el.querySelector("[" + _utils_constants_markup__WEBPACK_IMPORTED_MODULE_2__[/* LINE_MARKUP */ "c"] + "=\"" + lineIndex + "\"]");
if (target) this.scrollToTarget({
target: target,
onScrollEnd: onScrollEnd
});
}
}
}
});
/***/ }),
/* 17 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _asyncToGenerator; });
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
/***/ }),
/* 18 */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/* 19 */
/***/ (function(module, exports, __webpack_require__) {
/**
* default settings
*
* @author Zongmin Lei<leizongmin@gmail.com>
*/
var FilterCSS = __webpack_require__(14).FilterCSS;
var getDefaultCSSWhiteList = __webpack_require__(14).getDefaultWhiteList;
var _ = __webpack_require__(15);
function getDefaultWhiteList() {
return {
a: ["target", "href", "title"],
abbr: ["title"],
address: [],
area: ["shape", "coords", "href", "alt"],
article: [],
aside: [],
audio: [
"autoplay",
"controls",
"crossorigin",
"loop",
"muted",
"preload",
"src",
],
b: [],
bdi: ["dir"],
bdo: ["dir"],
big: [],
blockquote: ["cite"],
br: [],
caption: [],
center: [],
cite: [],
code: [],
col: ["align", "valign", "span", "width"],
colgroup: ["align", "valign", "span", "width"],
dd: [],
del: ["datetime"],
details: ["open"],
div: [],
dl: [],
dt: [],
em: [],
figcaption: [],
figure: [],
font: ["color", "size", "face"],
footer: [],
h1: [],
h2: [],
h3: [],
h4: [],
h5: [],
h6: [],
header: [],
hr: [],
i: [],
img: ["src", "alt", "title", "width", "height"],
ins: ["datetime"],
li: [],
mark: [],
nav: [],
ol: [],
p: [],
pre: [],
s: [],
section: [],
small: [],
span: [],
sub: [],
summary: [],
sup: [],
strong: [],
strike: [],
table: ["width", "border", "align", "valign"],
tbody: ["align", "valign"],
td: ["width", "rowspan", "colspan", "align", "valign"],
tfoot: ["align", "valign"],
th: ["width", "rowspan", "colspan", "align", "valign"],
thead: ["align", "valign"],
tr: ["rowspan", "align", "valign"],
tt: [],
u: [],
ul: [],
video: [
"autoplay",
"controls",
"crossorigin",
"loop",
"muted",
"playsinline",
"poster",
"preload",
"src",
"height",
"width",
],
};
}
var defaultCSSFilter = new FilterCSS();
/**
* default onTag function
*
* @param {String} tag
* @param {String} html
* @param {Object} options
* @return {String}
*/
function onTag(tag, html, options) {
// do nothing
}
/**
* default onIgnoreTag function
*
* @param {String} tag
* @param {String} html
* @param {Object} options
* @return {String}
*/
function onIgnoreTag(tag, html, options) {
// do nothing
}
/**
* default onTagAttr function
*
* @param {String} tag
* @param {String} name
* @param {String} value
* @return {String}
*/
function onTagAttr(tag, name, value) {
// do nothing
}
/**
* default onIgnoreTagAttr function
*
* @param {String} tag
* @param {String} name
* @param {String} value
* @return {String}
*/
function onIgnoreTagAttr(tag, name, value) {
// do nothing
}
/**
* default escapeHtml function
*
* @param {String} html
*/
function escapeHtml(html) {
return html.replace(REGEXP_LT, "<").replace(REGEXP_GT, ">");
}
/**
* default safeAttrValue function
*
* @param {String} tag
* @param {String} name
* @param {String} value
* @param {Object} cssFilter
* @return {String}
*/
function safeAttrValue(tag, name, value, cssFilter) {
// unescape attribute value firstly
value = friendlyAttrValue(value);
if (name === "href" || name === "src") {
// filter `href` and `src` attribute
// only allow the value that starts with `http://` | `https://` | `mailto:` | `/` | `#`
value = _.trim(value);
if (value === "#") return "#";
if (
!(
value.substr(0, 7) === "http://" ||
value.substr(0, 8) === "https://" ||
value.substr(0, 7) === "mailto:" ||
value.substr(0, 4) === "tel:" ||
value.substr(0, 11) === "data:image/" ||
value.substr(0, 6) === "ftp://" ||
value.substr(0, 2) === "./" ||
value.substr(0, 3) === "../" ||
value[0] === "#" ||
value[0] === "/"
)
) {
return "";
}
} else if (name === "background") {
// filter `background` attribute (maybe no use)
// `javascript:`
REGEXP_DEFAULT_ON_TAG_ATTR_4.lastIndex = 0;
if (REGEXP_DEFAULT_ON_TAG_ATTR_4.test(value)) {
return "";
}
} else if (name === "style") {
// `expression()`
REGEXP_DEFAULT_ON_TAG_ATTR_7.lastIndex = 0;
if (REGEXP_DEFAULT_ON_TAG_ATTR_7.test(value)) {
return "";
}
// `url()`
REGEXP_DEFAULT_ON_TAG_ATTR_8.lastIndex = 0;
if (REGEXP_DEFAULT_ON_TAG_ATTR_8.test(value)) {
REGEXP_DEFAULT_ON_TAG_ATTR_4.lastIndex = 0;
if (REGEXP_DEFAULT_ON_TAG_ATTR_4.test(value)) {
return "";
}
}
if (cssFilter !== false) {
cssFilter = cssFilter || defaultCSSFilter;
value = cssFilter.process(value);
}
}
// escape `<>"` before returns
value = escapeAttrValue(value);
return value;
}
// RegExp list
var REGEXP_LT = /</g;
var REGEXP_GT = />/g;
var REGEXP_QUOTE = /"/g;
var REGEXP_QUOTE_2 = /"/g;
var REGEXP_ATTR_VALUE_1 = /&#([a-zA-Z0-9]*);?/gim;
var REGEXP_ATTR_VALUE_COLON = /:?/gim;
var REGEXP_ATTR_VALUE_NEWLINE = /&newline;?/gim;
var REGEXP_DEFAULT_ON_TAG_ATTR_3 = /\/\*|\*\//gm;
var REGEXP_DEFAULT_ON_TAG_ATTR_4 = /((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a)\:/gi;
var REGEXP_DEFAULT_ON_TAG_ATTR_5 = /^[\s"'`]*(d\s*a\s*t\s*a\s*)\:/gi;
var REGEXP_DEFAULT_ON_TAG_ATTR_6 = /^[\s"'`]*(d\s*a\s*t\s*a\s*)\:\s*image\//gi;
var REGEXP_DEFAULT_ON_TAG_ATTR_7 = /e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi;
var REGEXP_DEFAULT_ON_TAG_ATTR_8 = /u\s*r\s*l\s*\(.*/gi;
/**
* escape double quote
*
* @param {String} str
* @return {String} str
*/
function escapeQuote(str) {
return str.replace(REGEXP_QUOTE, """);
}
/**
* unescape double quote
*
* @param {String} str
* @return {String} str
*/
function unescapeQuote(str) {
return str.replace(REGEXP_QUOTE_2, '"');
}
/**
* escape html entities
*
* @param {String} str
* @return {String}
*/
function escapeHtmlEntities(str) {
return str.replace(REGEXP_ATTR_VALUE_1, function replaceUnicode(str, code) {
return code[0] === "x" || code[0] === "X"
? String.fromCharCode(parseInt(code.substr(1), 16))
: String.fromCharCode(parseInt(code, 10));
});
}
/**
* escape html5 new danger entities
*
* @param {String} str
* @return {String}
*/
function escapeDangerHtml5Entities(str) {
return str
.replace(REGEXP_ATTR_VALUE_COLON, ":")
.replace(REGEXP_ATTR_VALUE_NEWLINE, " ");
}
/**
* clear nonprintable characters
*
* @param {String} str
* @return {String}
*/
function clearNonPrintableCharacter(str) {
var str2 = "";
for (var i = 0, len = str.length; i < len; i++) {
str2 += str.charCodeAt(i) < 32 ? " " : str.charAt(i);
}
return _.trim(str2);
}
/**
* get friendly attribute value
*
* @param {String} str
* @return {String}
*/
function friendlyAttrValue(str) {
str = unescapeQuote(str);
str = escapeHtmlEntities(str);
str = escapeDangerHtml5Entities(str);
str = clearNonPrintableCharacter(str);
return str;
}
/**
* unescape attribute value
*
* @param {String} str
* @return {String}
*/
function escapeAttrValue(str) {
str = escapeQuote(str);
str = escapeHtml(str);
return str;
}
/**
* `onIgnoreTag` function for removing all the tags that are not in whitelist
*/
function onIgnoreTagStripAll() {
return "";
}
/**
* remove tag body
* specify a `tags` list, if the tag is not in the `tags` list then process by the specify function (optional)
*
* @param {array} tags
* @param {function} next
*/
function StripTagBody(tags, next) {
if (typeof next !== "function") {
next = function () {};
}
var isRemoveAllTag = !Array.isArray(tags);
function isRemoveTag(tag) {
if (isRemoveAllTag) return true;
return _.indexOf(tags, tag) !== -1;
}
var removeList = [];
var posStart = false;
return {
onIgnoreTag: function (tag, html, options) {
if (isRemoveTag(tag)) {
if (options.isClosing) {
var ret = "[/removed]";
var end = options.position + ret.length;
removeList.push([
posStart !== false ? posStart : options.position,
end,
]);
posStart = false;
return ret;
} else {
if (!posStart) {
posStart = options.position;
}
return "[removed]";
}
} else {
return next(tag, html, options);
}
},
remove: function (html) {
var rethtml = "";
var lastPos = 0;
_.forEach(removeList, function (pos) {
rethtml += html.slice(lastPos, pos[0]);
lastPos = pos[1];
});
rethtml += html.slice(lastPos);
return rethtml;
},
};
}
/**
* remove html comments
*
* @param {String} html
* @return {String}
*/
function stripCommentTag(html) {
return html.replace(STRIP_COMMENT_TAG_REGEXP, "");
}
var STRIP_COMMENT_TAG_REGEXP = /<!--[\s\S]*?-->/g;
/**
* remove invisible characters
*
* @param {String} html
* @return {String}
*/
function stripBlankChar(html) {
var chars = html.split("");
chars = chars.filter(function (char) {
var c = char.charCodeAt(0);
if (c === 127) return false;
if (c <= 31) {
if (c === 10 || c === 13) return true;
return false;
}
return true;
});
return chars.join("");
}
exports.whiteList = getDefaultWhiteList();
exports.getDefaultWhiteList = getDefaultWhiteList;
exports.onTag = onTag;
exports.onIgnoreTag = onIgnoreTag;
exports.onTagAttr = onTagAttr;
exports.onIgnoreTagAttr = onIgnoreTagAttr;
exports.safeAttrValue = safeAttrValue;
exports.escapeHtml = escapeHtml;
exports.escapeQuote = escapeQuote;
exports.unescapeQuote = unescapeQuote;
exports.escapeHtmlEntities = escapeHtmlEntities;
exports.escapeDangerHtml5Entities = escapeDangerHtml5Entities;
exports.clearNonPrintableCharacter = clearNonPrintableCharacter;
exports.friendlyAttrValue = friendlyAttrValue;
exports.escapeAttrValue = escapeAttrValue;
exports.onIgnoreTagStripAll = onIgnoreTagStripAll;
exports.StripTagBody = StripTagBody;
exports.stripCommentTag = stripCommentTag;
exports.stripBlankChar = stripBlankChar;
exports.cssFilter = defaultCSSFilter;
exports.getDefaultCSSWhiteList = getDefaultCSSWhiteList;
/***/ }),
/* 20 */
/***/ (function(module, exports) {
/**
* cssfilter
*
* @author 老雷<leizongmin@gmail.com>
*/
function getDefaultWhiteList () {
// 白名单值说明:
// true: 允许该属性
// Function: function (val) { } 返回true表示允许该属性,其他值均表示不允许
// RegExp: regexp.test(val) 返回true表示允许该属性,其他值均表示不允许
// 除上面列出的值外均表示不允许
var whiteList = {};
whiteList['align-content'] = false; // default: auto
whiteList['align-items'] = false; // default: auto
whiteList['align-self'] = false; // default: auto
whiteList['alignment-adjust'] = false; // default: auto
whiteList['alignment-baseline'] = false; // default: baseline
whiteList['all'] = false; // default: depending on individual properties
whiteList['anchor-point'] = false; // default: none
whiteList['animation'] = false; // default: depending on individual properties
whiteList['animation-delay'] = false; // default: 0
whiteList['animation-direction'] = false; // default: normal
whiteList['animation-duration'] = false; // default: 0
whiteList['animation-fill-mode'] = false; // default: none
whiteList['animation-iteration-count'] = false; // default: 1
whiteList['animation-name'] = false; // default: none
whiteList['animation-play-state'] = false; // default: running
whiteList['animation-timing-function'] = false; // default: ease
whiteList['azimuth'] = false; // default: center
whiteList['backface-visibility'] = false; // default: visible
whiteList['background'] = true; // default: depending on individual properties
whiteList['background-attachment'] = true; // default: scroll
whiteList['background-clip'] = true; // default: border-box
whiteList['background-color'] = true; // default: transparent
whiteList['background-image'] = true; // default: none
whiteList['background-origin'] = true; // default: padding-box
whiteList['background-position'] = true; // default: 0% 0%
whiteList['background-repeat'] = true; // default: repeat
whiteList['background-size'] = true; // default: auto
whiteList['baseline-shift'] = false; // default: baseline
whiteList['binding'] = false; // default: none
whiteList['bleed'] = false; // default: 6pt
whiteList['bookmark-label'] = false; // default: content()
whiteList['bookmark-level'] = false; // default: none
whiteList['bookmark-state'] = false; // default: open
whiteList['border'] = true; // default: depending on individual properties
whiteList['border-bottom'] = true; // default: depending on individual properties
whiteList['border-bottom-color'] = true; // default: current color
whiteList['border-bottom-left-radius'] = true; // default: 0
whiteList['border-bottom-right-radius'] = true; // default: 0
whiteList['border-bottom-style'] = true; // default: none
whiteList['border-bottom-width'] = true; // default: medium
whiteList['border-collapse'] = true; // default: separate
whiteList['border-color'] = true; // default: depending on individual properties
whiteList['border-image'] = true; // default: none
whiteList['border-image-outset'] = true; // default: 0
whiteList['border-image-repeat'] = true; // default: stretch
whiteList['border-image-slice'] = true; // default: 100%
whiteList['border-image-source'] = true; // default: none
whiteList['border-image-width'] = true; // default: 1
whiteList['border-left'] = true; // default: depending on individual properties
whiteList['border-left-color'] = true; // default: current color
whiteList['border-left-style'] = true; // default: none
whiteList['border-left-width'] = true; // default: medium
whiteList['border-radius'] = true; // default: 0
whiteList['border-right'] = true; // default: depending on individual properties
whiteList['border-right-color'] = true; // default: current color
whiteList['border-right-style'] = true; // default: none
whiteList['border-right-width'] = true; // default: medium
whiteList['border-spacing'] = true; // default: 0
whiteList['border-style'] = true; // default: depending on individual properties
whiteList['border-top'] = true; // default: depending on individual properties
whiteList['border-top-color'] = true; // default: current color
whiteList['border-top-left-radius'] = true; // default: 0
whiteList['border-top-right-radius'] = true; // default: 0
whiteList['border-top-style'] = true; // default: none
whiteList['border-top-width'] = true; // default: medium
whiteList['border-width'] = true; // default: depending on individual properties
whiteList['bottom'] = false; // default: auto
whiteList['box-decoration-break'] = true; // default: slice
white