Skip to content

enhancement: Set RichTextEditor to save content as html#1348

Open
MrDirkelz wants to merge 6 commits intomainfrom
1346-cms-api-save-tiptap-editor-output-as-html-and-not-json-for-better-search-compatibility
Open

enhancement: Set RichTextEditor to save content as html#1348
MrDirkelz wants to merge 6 commits intomainfrom
1346-cms-api-save-tiptap-editor-output-as-html-and-not-json-for-better-search-compatibility

Conversation

@MrDirkelz
Copy link
Collaborator

No description provided.

@MrDirkelz MrDirkelz changed the title chore: Update rte-vue to version 1.0.7 in package.json and package-lock.json enhancement: Set RichTextEditor to save content as html Feb 24, 2026
@MrDirkelz
Copy link
Collaborator Author

Questions for standup meeting 2026-02-25:
The RichTextEditor now saves content as html - the goal was so we can remmove the tiptap generate html function from the app and just use the html directly - but - doing this could break the app, as most of the content uses json, so we could either:

write a script that converts all content to just the html or we keep the tiptap way in for now, and still render the html directly if it is available (so we wouldn't have to run the renderHtml function for now aand could just lazy load it until it is really required)

Or maybe there is a better solution I am nto thinking of?

Copy link
Contributor

@ivanslabbert ivanslabbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add an upgrade script which upgrades all documents with TipTap formatted text fields (important that it should skip docs that already are formatted correctly)

The TipTap components can then also be removed from the client app.

…move frontend TipTap dependencies, and introduce a new database schema upgrade.
…d of JSON structures for better rendering consistency
Copy link
Contributor

@ivanslabbert ivanslabbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with comment

*/
function isTipTapJson(text: string): boolean {
try {
const parsed = JSON.parse(text);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a check to see if the first char is a "{". If not, assume it is HTML and skip. This should improve the performance of the upgrade script (most docs are formatted in HTML as they were imported from activechristianity.africa).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CMS & API: Save TipTap editor output as HTML and not JSON for better search compatibility

2 participants