-
-
Notifications
You must be signed in to change notification settings - Fork 590
blank spaces at the beginning of line will change to code block #75
Comments
This is due to the markdown parser interpreting paragraphs indented by several spaces as code, which is definitely a standard. I think the answer is to remove that from the parsing engine, it won't work with imported documents that use this formatting then but they can be easily fixed in the editor. |
It's a feature, not a bug.
Most of the times, I use backticks |
Easiest way is change your behavior in writing docs. Second easiest, would a css style override to make it visually look like normal (indented) text to you, qualify? |
Hey @smeijer , please don't misquote me! Whilst it is a feature of the Markdown standard to use spaces to indent code, this editor is not aiming to be an editor for any Markdown that you can throw at it – only the subset of valid Markdown that it produces. I DO think that as the editor will never produce code indented with spaces (only backticks), that this parsing should be removed. As I mentioned, in the rare case that someone imports a doc with spaces then it is easily fixed either manually, or as part of the import process. The code in question is around here: |
Thanks @tommoor, I removed this feature according to your suggestion. I should inform you the use cases. In Chinese, we often use blanks at the beginning of a paragraph. |
Sorry, about that. That wasn't on purpose. I totally misread your comment, and fixed mine by now. Turns out, I don't agree with that post of you. But I do understand your addition.
I can agree with that. |
@smeijer or @hecor Do either of you know where this behavior is set in ProseMirror (since we've moved away from Slate)? I realize converting tabs or spaces to code blocks is expected behavior in some editors, but I'd love to know how to change this so users could put tabs in front of paragraphs (think school essays, or novels). It's just a style preference I'd like to offer, but I'm not sure where to tweak this behavior. Any and all help is much appreciated 🙏 |
Honestly I'd consider it a bug now that 4 spaces at the beginning of a paragraph becomes code when you reload, but lets create a new issue as this is so old. |
Hmmm I can no longer reproduce the issue actually, weird! If it comes back I'll report it as a bug, but honestly I think I might try to tackle this with CSS anyway, to avoid polluting the original document with extra characters. |
Editing status:
Edit done status:
thanks.
The text was updated successfully, but these errors were encountered: