Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: editor as viewer, preview mode #847

Open
Be1zebub opened this issue Jan 27, 2024 · 0 comments
Open

Feature request: editor as viewer, preview mode #847

Be1zebub opened this issue Jan 27, 2024 · 0 comments

Comments

@Be1zebub
Copy link

Markdown editor can be used as markdown viewer.
I use this hack todo this:

const mde = new SimpleMDE({
	element: document.querySelector("#profile-bio > .markdown-preview > textarea"),
	toolbar: ["preview"],
	initialValue: "Lorem **ipsum**."
});

// actiate preview mode
mde.togglePreview();
/* hide all editor related ui, for preview only mde */
.markdown-preview > .CodeMirror,
.markdown-preview > .CodeMirror > .editor-preview {
	background-color: transparent;
	padding: 0;
}

.markdown-preview > .CodeMirror > .editor-preview {
	display: contents;
}

.markdown-preview > .CodeMirror > .CodeMirror-scroll {
	display: none;
}

.markdown-preview > .editor-toolbar {
	display: none !important;
}
.markdown-preview > .editor-statusbar {
	display: none !important;
}

I would like to request the addition of this feature, with activation via option - like:

const mde = new SimpleMDE({
	element: document.querySelector("#profile-bio > textarea"),
	initialValue: "Lorem **ipsum**.",
	previewMode: true
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant