django-markdownx
django-markdownx copied to clipboard
Do not render Markdown if editor has no content (solution attached)
Sorry, I want to help by I have no time to setup the dev environment :-(
Problem Right now for new forms with markdownx, there is an empty POST request after the editor initialization and each time when everything was removed and there is no content left.
Solution
Please add this at the beginning of getMarkdown
function.
if (!properties.editor.value) {
properties.preview.innerHTML = '';
properties.editor = updateHeight(properties.editor);
return;
}
I need to look into this. As far as I remember It was done on purpose (but I don't really remember now what exactly) or it was kind of a feature
for some other functionality.