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

smallCaps

parent fd6b6788
No related branches found
No related tags found
1 merge request!45Develop
import { toggleMark } from "prosemirror-commands";
import { markActive } from "../../lib/Utils";
import Tools from "../../lib/Tools";
import { injectable } from "inversify";
import { icons } from "wax-prosemirror-components";
@injectable()
export default class SmallCaps extends Tools {
title = "Toggle Small Caps";
content = icons.small_caps;
get run() {
return (state, dispatch) => {
toggleMark(state.config.schema.marks.small_caps)(state, dispatch);
};
}
get active() {
return state => {
return markActive(state.config.schema.marks.small_caps)(state);
};
}
}
export { default as Blockquote } from "./Blockquote";
export { default as SmallCaps } from "./SmallCaps";
export { default as Table } from "./Table";
export { default as TableDropDownOptions } from "./TableDropDownOptions";
......@@ -5,6 +5,7 @@ import SubscriptService from "./SubscriptService/SubscriptService";
import SuperscriptService from "./SuperscriptService/SuperscriptService";
import StrikeThroughService from "./StrikeThroughService/StrikeThroughService";
import UnderlineService from "./UnderlineService/UnderlineService";
import SmallCapsService from "./SmallCapsService/SmallCapsService";
export default [
new CodeService(),
......@@ -13,5 +14,6 @@ export default [
new SubscriptService(),
new SuperscriptService(),
new StrikeThroughService(),
new UnderlineService()
new UnderlineService(),
new SmallCapsService()
];
......@@ -3,23 +3,6 @@ const emDOM = ["em", 0],
codeDOM = ["code", 0];
const marks = {
small_caps: {
attrs: {
class: { default: "small-caps" }
},
// inclusive: false,
parseDOM: [
{
tag: "span.small-caps",
getAttrs(dom) {
return { class: dom.getAttribute("class") };
}
}
],
toDOM(node) {
return ["span", node.attrs, 0];
}
},
source: {
parseDOM: [{ tag: "cite" }],
toDOM() {
......
......@@ -11,8 +11,9 @@ const smallcaps = {
}
}
],
toDOM(node) {
return ["span", node.attrs, 0];
toDOM(hook, next) {
hook.value = ["span", hook.node.attrs, 0];
next();
}
};
......
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