diff --git a/core/static/bundled/core/components/easymde-index.ts b/core/static/bundled/core/components/easymde-index.ts index adc01bb4..54f1a134 100644 --- a/core/static/bundled/core/components/easymde-index.ts +++ b/core/static/bundled/core/components/easymde-index.ts @@ -60,6 +60,7 @@ const loadEasyMde = (textarea: HTMLTextAreaElement) => { }); easymde.codemirror.replaceSelection("\n"); }, + previewClass: ["editor-preview", "markdown"], // default class + our own markdown class previewRender: (plainText) => markdown(plainText), forceSync: true, // Avoid validation error on generic create view imageTexts: { diff --git a/core/static/core/markdown.scss b/core/static/core/markdown.scss index 098d86be..10aeb338 100644 --- a/core/static/core/markdown.scss +++ b/core/static/core/markdown.scss @@ -33,6 +33,15 @@ padding: 1px 2px; } + /** + * Some restyling rules for the cases where our own md css + * conflicts with the easymde editor preview css + */ + &.editor-preview { + pre { + background: unset; + } + } pre code { // code that is not inlined margin: 15px;