EasyMDE: A simple, beautiful, and embeddable JavaScript Markdown editor. Delightful editing for beginners and experts alike. Features built-in autosaving and spell checking.
It would be nice to have more control over the preview styling.
In our app users can write content (in EasyMDE) and we render this content with specific styling. I want to apply the same styling to the preview in EasyMDE without having to override default styling from .editor-preview and .editor-preview-side.
Proposal
Introduce a classname solely for preview content styling, e.g. .editor-preview-content. And use .editor-preview and .editor-preview-side only for positioning the preview within the editor.
In addition introduce an option to set a custom class(es):
const editor = new EasyMDE({
// Default class
previewClass: "editor-preview-content",
// Custom class
previewClass: "custom-editor",
// Default and custom class
previewClass: ["editor-preview-content", "custom-overrides"],
});
Personally I think editor-preview as default for the content would be better, and use .editor-preview-full and .editor-preview-side for internal display variants.
Alternative solution would be building a separate css file for the bare editor styling, e.g. easymde-nopreview.css. This way we have more control over what styling we import.
It would be nice to have more control over the preview styling. In our app users can write content (in EasyMDE) and we render this content with specific styling. I want to apply the same styling to the preview in EasyMDE without having to override default styling from
.editor-preview
and.editor-preview-side
.Proposal
Introduce a classname solely for preview content styling, e.g.
.editor-preview-content
. And use.editor-preview
and.editor-preview-side
only for positioning the preview within the editor.In addition introduce an option to set a custom class(es):
Personally I think
editor-preview
as default for the content would be better, and use.editor-preview-full
and.editor-preview-side
for internal display variants.Alternative solution would be building a separate css file for the bare editor styling, e.g.
easymde-nopreview.css
. This way we have more control over what styling we import.Related issues (from SimpleMDE):