Replies: 1 comment
-
If it makes a difference, the main requirement I am trying to solve in my application is the ability to paste any rich text content into our editor and keep source formatting (e.g. paste in text from an email chain and maintain quote blocks, indented lists, marks, etc.) |
Beta Was this translation helpful? Give feedback.
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am working on setting up rich text capabilities in my application using Plate. So far things are going well by making use of the examples (I.E. https://codesandbox.io/s/5nd78j?file=/App.tsx&from-sandpack=true), but I am having a hard time understanding what the
validTypes
prop is for on the plugins. I see that in almost every example,validTypes
is provided a list of Element types, for example:export const indentListPlugin: Partial<MyPlatePlugin<IndentListPlugin>> = { inject: { props: { validTypes: [ ELEMENT_PARAGRAPH, ELEMENT_H1, ELEMENT_H2, ELEMENT_H3, ELEMENT_H4, ELEMENT_H5, ELEMENT_H6, ELEMENT_BLOCKQUOTE, ELEMENT_CODE_BLOCK ] } } };
The docs say this, but unfortunately this doesn't add much to my understanding:
Could you please explain the purpose of this prop? I have played around with my editor with and without this prop, and I don't notice any difference in functionality. Thanks.
(I searched 'validTypes' in the discussions and there were no results)
Beta Was this translation helpful? Give feedback.
All reactions