1.0.4 • Published 3 months ago
@tanglemedia/directus-extension-plainify-flex v1.0.4
@tanglemedia/directus-extension-plainify-flex
This package converts flexible content into a plain content
Requirements
- Directus >= 10.10.1
Node >= 18.x.x
To use this extension, you should have the following installed in your Directus project already:
- @tanglemedia/directus-collection-flex-editor
Install
npm i @tanglemedia/directus-extension-plainify-flex
How does this extension?
A flexible content is assumed to be in JSON format that follows the tiptap format. Example of it is as follows:
{
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Wow, this editor instance exports its content as JSON."
}
]
}
]
}
Then everytime a module that uses the flexible content editor is saved, this extension converts the above JSON format into a plain string.
Wow, this editor instance exports its content as JSON.
As of this writing, paragraphs, headings, lists, blockquote, and codeblocks are the only elements in the flexible content editor that can be converted into plain content.