Is there a way to add a custom css class to the editor-preview?
At this time, there is not. It comes standard with the editor-preview class.
Will this ever become a thing? It's quite handy if you already have styles defined for a specific container, so it will actually look like the preview when rendered there.
I did this by overriding previewRender:
previewRender: (plainText, previewArg) => {
const preview = previewArg;
setTimeout(() => {
preview.innerHTML = `
<div class="content">${marked(plainText)}</div>
`;
}, 1);
return `Loading...`;
}
Most helpful comment
I did this by overriding previewRender: