|
|
|
@ -1,15 +1,15 @@
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
module.exports = function generateItemStyle(item, options) {
|
|
|
|
|
let style = Object.assign({}, options.defaultStyle);
|
|
|
|
|
module.exports = function generateItemStyle(tags, classes) {
|
|
|
|
|
let style = {};
|
|
|
|
|
|
|
|
|
|
item.tags.forEach((tag) => {
|
|
|
|
|
tags.forEach((tag) => {
|
|
|
|
|
if (tag.type === "class") {
|
|
|
|
|
tag.classNames.forEach((className) => {
|
|
|
|
|
if (options.classes[className] == null) {
|
|
|
|
|
if (classes[className] == null) {
|
|
|
|
|
throw new Error(`Encountered unrecognized class ${className} in text`);
|
|
|
|
|
} else {
|
|
|
|
|
Object.assign(style, options.classes[className]);
|
|
|
|
|
Object.assign(style, classes[className]);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|