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

strongService

parent 2e027a77
No related branches found
No related tags found
1 merge request!45Develop
export { default as TrackChangePlugin } from "./src/trackChanges/TrackChangePlugin";
export {
default as TrackChangePlugin
} from "./src/trackChanges/TrackChangePlugin";
export { default as FindAndReplacePlugin } from "./src/FindAndReplacePlugin";
export { default as OverlayPlugin } from "./src/overlay/OverlayPlugin";
export { default as LinkService } from "./src/LinkService/LinkService";
export { default as MenuService } from "./src/MenuService/MenuService";
export { default as RedoUndoService } from "./src/RedoUndoService/RedoUndoService";
export { default as AnnotationService } from "./src/AnnotationService/AnnotationService";
export { default as TextStyleService } from "./src/TextStyleService/TextStyleService";
export { default as PlaceholderService } from "./src/PlaceholderService/PlaceholderService";
export {
default as RedoUndoService
} from "./src/RedoUndoService/RedoUndoService";
export {
default as AnnotationService
} from "./src/AnnotationService/AnnotationService";
export {
default as TextStyleService
} from "./src/TextStyleService/TextStyleService";
export {
default as PlaceholderService
} from "./src/PlaceholderService/PlaceholderService";
export { default as ImageService } from "./src/ImageService/ImageService";
export { default as RulesService } from "./src/RulesService/RulesService";
export { default as SchemaService } from "./src/SchemaService/SchemaService";
export { default as ShortCutsService } from "./src/ShortCutsService/ShortCutsService";
export {
default as ShortCutsService
} from "./src/ShortCutsService/ShortCutsService";
export { default as Tool } from "./src/lib/Tools";
export { default as InlineAnnotationsService } from "./src/InlineAnnotations/InlineAnnotationsService";
export { default as OverlayService } from "./src/OverlayService/OverlayService";
export {
default as InlineAnnotationsService
} from "./src/InlineAnnotations/InlineAnnotationsService";
// export { default as OverlayService } from "./src/OverlayService/OverlayService";
......@@ -4,7 +4,7 @@ export { default as Em } from "./Em";
export { default as Link } from "./Link";
export { default as SmallCaps } from "./SmallCaps";
export { default as StrikeThrough } from "./StrikeThrough";
export { default as Strong } from "./Strong";
// export { default as Strong } from "./Strong";
export { default as Subscript } from "./Subscript";
export { default as Superscript } from "./Superscript";
export { default as Underline } from "./Underline";
......
import Service from "wax-prosemirror-core/src/services/Service";
import { codeMark } from "wax-prosemirror-schema";
import Code from "./Code";
console.log(codeMark);
class CodeService extends Service {
boot() {
const createMark = this.container.get("CreateMark");
createMark({
code: {
parseDOM: { tag: "code" },
toDOM(hook, next) {
hook.value = ["code", 0];
next();
}
}
});
createMark({ code: codeMark });
}
register() {
......
import CodeService from "./CodeService/CodeService";
export default [new CodeService()];
import StrongService from "./StrongService/StrongService";
export default [new CodeService(), new StrongService()];
......@@ -2,3 +2,4 @@ export { default as DefaultSchema } from "./src/DefaultSchema";
export { default as EditoriaSchema } from "./src/editoria/EditoriaSchema";
export { default as XpubSchema } from "./src/XpubSchema";
export { default as codeMark } from "./src/marks/codeMark";
export { default as strongMark } from "./src/marks/strongMark";
......@@ -35,22 +35,22 @@ const marks = {
return emDOM;
}
},
strong: {
parseDOM: [
{ tag: "strong" },
{
tag: "b",
getAttrs: node => node.style.fontWeight != "normal" && null
},
{
style: "font-weight",
getAttrs: value => /^(bold(er)?|[5-9]\d{2,})$/.test(value) && null
}
],
toDOM() {
return strongDOM;
}
},
// strong: {
// parseDOM: [
// { tag: "strong" },
// {
// tag: "b",
// getAttrs: node => node.style.fontWeight != "normal" && null
// },
// {
// style: "font-weight",
// getAttrs: value => /^(bold(er)?|[5-9]\d{2,})$/.test(value) && null
// }
// ],
// toDOM() {
// return strongDOM;
// }
// },
// code: {
// parseDOM: [{ tag: "code" }],
// toDOM() {
......
const code = {
parseDOM: [{ tag: "code" }],
toDOM() {
return ["code", 0];
parseDOM: { tag: "code" },
toDOM(hook, next) {
hook.value = ["code", 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