Skip to content
Snippets Groups Projects
Commit b6a9e7b6 authored by chris's avatar chris
Browse files

marks for editoria

parent 5e3f6081
No related branches found
No related tags found
1 merge request!231Connect funcionality
const em = {
parseDOM: [{ tag: "i" }, { tag: "em" }, { style: "font-style=italic" }],
parseDOM: [{ tag: 'i' }, { tag: 'em' }, { style: 'font-style=italic' }],
toDOM(hook, next) {
hook.value = ["em", 0];
hook.value = ['em', 0];
next();
}
},
};
export default em;
// const highlight = {
// parseDOM: [
// { tag: "highlight" },
// { style: "color:red" },
// ],
// toDOM: (hook, next) => {
// hook.value = [
// "highlight",
// {
// style: "background-color:red"
// }
// ];
// next();
// }
// };
const highlight = {
attrs: {
style: { default: null }
const highlight = {
attrs: {
style: { default: null },
class: { default: 'highlight' },
},
inclusive: false,
parseDOM: [
{
tag: 'span.highlight',
getAttrs(hook, next) {
Object.assign(hook, {
class: hook.dom.getAttribute('class'),
style: hook.dom.getAttribute('style'),
});
next();
},
},
inclusive: false,
parseDOM: [
{
tag: "highlight",
getAttrs(hook, next) {
const style = hook.dom.getAttribute("style");
Object.assign(hook, {
style: hook.dom.getAttribute("style"),
});
next();
}
}
],
toDOM(hook, next) {
hook.value = ["highlight", hook.node.attrs, 0];
next();
}
};
export default highlight;
\ No newline at end of file
],
toDOM(hook, next) {
// eslint-disable-next-line no-param-reassign
hook.value = ['span', hook.node.attrs, 0];
next();
},
};
export default highlight;
const smallcaps = {
attrs: {
class: { default: "small-caps" }
class: { default: 'small-caps' },
},
// inclusive: false,
parseDOM: [
{
tag: "span.small-caps",
tag: 'span.small-caps',
getAttrs(dom) {
return { class: dom.getAttribute("class") };
}
}
return { class: dom.getAttribute('class') };
},
},
],
toDOM(hook, next) {
hook.value = ["span", hook.node.attrs, 0];
hook.value = ['span', hook.node.attrs, 0];
next();
}
},
};
export default smallcaps;
const strikethrough = {
attrs: {
class: { default: 'strikethrough' },
style: { default: 'text-decoration:line-through' },
},
inclusive: false,
parseDOM: [
{ tag: "strike" },
{ style: "text-decoration:line-through" },
{ style: "text-decoration-line:line-through" }
{
tag: 'span.strikethrough',
getAttrs(hook, next) {
Object.assign(hook, {
class: hook.dom.getAttribute('class'),
style: hook.dom.getAttribute('style'),
});
next();
},
},
],
toDOM: (hook, next) => {
hook.value = [
"span",
{
style: "text-decoration-line:line-through"
}
];
toDOM(hook, next) {
// eslint-disable-next-line no-param-reassign
hook.value = ['span', hook.node.attrs, 0];
next();
}
},
};
export default strikethrough;
const underline = {
parseDOM: [{ tag: "u" }, { style: "text-decoration:underline" }],
parseDOM: [{ tag: 'u' }],
toDOM: (hook, next) => {
hook.value = [
"span",
{
style: "text-decoration:underline"
}
];
// eslint-disable-next-line no-param-reassign
hook.value = ['u'];
next();
}
},
};
export default underline;
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment