CKEditor5 - Wrapping entire contents in a div

Viewed 75

I'm using CKEditor to create content that can be loaded as a template into a generic Vue (still on Vue 2) component like this:

<component v-if="html" :is="{template: html}>

I need the template loading so the contents can be "live" such as router-links, etc. In order to use this functionality the html template must have a single root element, but the output value of the CKEditor element will usually have multiple root elements. Using v-html such as

<div v-if="html" v-html="html">

does not work because the contents won't be "live", that is, Vue won't wire a router-link tag into the router etc. Is there a way to get CKEditor to automatically wrap the contents in a div or other arbitrary wrapping element?

0 Answers
Related