microcms-richedit-processer
Version:
microCMSのリッチエディタから取得した値を加工したり、目次リストを作成します。
18 lines (17 loc) • 620 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var otherElementsProcesser = function (element, options) {
if (options.addAttributes !== undefined) {
var attributes_1 = options.addAttributes;
Object.keys(attributes_1).forEach(function (key) {
element.setAttribute(key, attributes_1[key]);
});
}
if (options.addClassName !== undefined) {
var classNames = options.addClassName;
classNames.forEach(function (className) {
element.classList.add(className);
});
}
};
exports.default = otherElementsProcesser;