Supporting multiple new lines in WYSIWYG editor through plugin?

Hi, this is my first post and first of all I'd like to thank the developers for this amazing app :slight_smile:

Coming from ~10y of using Evernote, the feature I miss the most is the ability to have multiple empty lines in the WYSIWYG editor. I don't know if my workflow is considered "wrong" or "messy" for Markdown, but I've tried to adapt for a few days (mainly adding . at the beginning of lines) and I'm not very satisfied with the result. The forum is full of posts asking for this feature, so it looks like a lot of people used to WYSIWYG editors expect this behavior.

I understand that this is just how Markdown works and the developers do not intend to change it, but I was wondering if there might be an "easy" workaround to this, perhaps using plugins. I see two potential solutions:

(non-)Solution 1
Tweak userstyle.css to make sure that multiple empty lines are converted to <br> tags when rendered. The good thing about this solution is that it would keep the Markdown code clear. I'm not even sure userstyle.css would allow this, but in any case I think this solution is not viable as the WYSIWYG doesn't support custom userstyle.css (yet, at least).

Solution 2
Add an optional setting to automatically convert multiple new lines in the WYSIWYG editor to an equal number of <br> tags in the underlying Markdown code. The downside here is that it would make the Markdown code a bit dirty, but I don't think that's a big issue as most WYSIWYG users won't deal much with the raw code anyway.

Solution 3
Add an optional setting to parse <br> tags in the WYSIWYG editor. Currently, if I type <br> tags in the WYSIWYG editor, this is automatically converted into &lt;br&gt; in the Markdown code, and hence doesn't render into an empty line. If <br> tags were left intact, they would be hidden as soon as the user exits and re-enters the note. This would also allow the user to configure OS-level shortcuts to quickly type <br>. This solution is a bit dirty but seems quite easy to me.

Question: Do you know if any of these solutions would be possible to implement using a plugin? I'm not really a developer but I might try and look into this if it was possible.

PS: more generally, I think it would actually be nice to be able to personalize the behavior of the Enter key. For example, I'd personally prefer the Enter key in the WYSIWYG editor to behave much like in the code editor, i.e.

  • producing a new line instead of a new paragraph (which now requires Shift + Enter).
  • producing a new paragraph with double Enter (which now requires a single Enter)
  • producing <br> tags with each subsequent Enter (which now is not supported)

This would reproduce more faithfully the workflow on plaintext note taking.

1 Like

I am not sure about the answers to all your questions, but as for Solution 1, I agree that CSS isn't the right solution. CSS is just styling the underlying code, so wouldn't be able to edit the structure.

I was wondering if you'd considered using the Markdown view with this plugin Plugin: Rich Markdown? Near the end of that thread we discuss adjusting CSS to make it look more like the WYSIWYG editor.

Not to discourage you on your path, just wanted to give you an option if you wanted something right away. I use multiple lines in my notes all the time, so I can see how that would be a frustration.

1 Like

@uxamanda I've given Rich Markdown (with your userchrome.css) a try and I have to say I'm quite impressed, thanks for the recommendation! I think that, at least until I can find a solution to the issue with multiple new lines, Rich Markdown might even be the best option for me. It's still not perfect for me because for some reasons I'd prefer to avoid always seeing all the code (mainly because long urls really impact readability), but this is off-topic.

I'd still like to hear if my solutions for the wysiwyg editor would in principle be possible, at least via a plugin.

I'll take the liberty to tag @tessus and @laurent, who have been active in other threads regarding this. I hope they won't mind :slight_smile:

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.