How do I disable certain markup options such as h1, h2, etc? #1779
Unanswered
benjaminkohl
asked this question in
Q&A
Replies: 3 comments
|
I think you can write your own schema and input rules for disabled markup (e.g, h1, h2), and use the customized plugins in your editor, it will override default schema and input rules. @benjaminkohl |
0 replies
|
Same for me. This is seriously driving me nuts because you'd think something like this should be possible: export const MilkdownEditor: FC = () => {
useEditor((root) => {
return new Crepe({
root,
defaultValue: markdown,
features: { [CrepeFeature.Toolbar]: true },
featureConfigs: { toolbar: { boldIcon: null, latexIcon: undefined } }, // <-- remove stuff
});
}, []);
return <Milkdown />;
};But it looks like there's no straight forward way to do this? |
0 replies
|
Just had the same problem, for me I did it like this: const blocked = [
"CodeBlock",
"Blockquote",
"InlineCode",
"Link",
"Hr",
"Image",
"Html",
];
commonmark.filter((plugin) => {
const group = plugin.meta?.group ?? "";
return !blocked.includes(group);
}),
but i have built my own editor so if your are using crepe it's probably a bit more involved since you would need to remove the bundled commonmark & gfm and then readd them with the filters. then you also need to hide the UI elements. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
I have tried figuring out how to disable some of the block edit tools from the documentation and I even had two different A.I.s try to explain how I can do it but I have not figured out how to disable certain markup options such as h1 or h2. There is only a subset of the tools that I need.
All reactions