Comments (7)
I have never liked this behavior of Markdown, luckily it looks like Marked has an option to enable GFM style line breaks. I'll see if this option will work.
from simplemde-markdown-editor.
@WesCossick: I'm confused because GFM handles single line breaks the same way.
Also, don't you use Marked for preview pane parsing only? This doesn't help if we're using a different GFM or Commonmark parser (not Marked) in our front end. My suggestion is to force double line break in the editor, so that the user cannot accidentally use single line breaks. ...or at least implement an opt-in setting to force double line breaks when user hits enter.
from simplemde-markdown-editor.
SimpleMDE uses GFM by default, so using GFM line breaks would be a desirable default, with the option to disable this. GFM line breaks can be seen in the commenting system, not their file editor.
The only previewing SimpleMDE handles is the preview pane, which does use Marked. The Markdown parser the developer chooses will need to follow GFM standards, which supports single line breaks. If the developer chooses Commonmark or another non-GFM parser, then many areas will be inconsistent.
A double line break would not work in most situations, i.e. at the end of any line that isn't a block of text. Bullet points, headers, tables, code blocks, etc. need single line breaks.
from simplemde-markdown-editor.
Hmm interesting,
GFM line breaks can be seen in the commenting system, not their file editor.
Ha, it's confusing that GitHub uses a different markdown standard from readme to comments. Line breaks are also not as clearly defined here as they could be.
A double line break would not work in most situations, i.e. at the end of any line that isn't a block of text. Bullet points, headers, tables, code blocks, etc. need single line breaks.
Didn't think of this, good point. That said, you could use the parser to detect where the user is trying to line-break from a normal block of text, versus lists, tables, etc. I'm beginning to think that this would need to be opt-in, not a default option. Though would still be nice to opt-in assuming it were smart enough to know where the user is trying to line break from.
My suggestion is getting a lot more complicated than I originally anticipated :P
from simplemde-markdown-editor.
SimpleMDE uses GFM by default
Maybe this could be mentioned in your readme? Also on that note, is it possible to switch out the parser for a Commonmark parser?
I sound like I'm complaining a lot here... really not, your package is awesome! These are all just suggestions :)
from simplemde-markdown-editor.
The next version of SimpleMDE will support single line breaks, which is consistent with how the editor displays them before the preview button is clicked, and consistent with GFM. I also think this is the most intuitive format, especially for non-technical users (the target audience).
I also added a mention that SimpleMDE uses GFM to the README, though there was a great place to mention it prominently. It should be fairly obvious though if you are familiar with the differences.
I do not currently have intentions of allowing the ability to switch out the parser, though. It could be added in the future, but I believe GFM is much better suited for the target audience. Plus it's more powerful in general.
from simplemde-markdown-editor.
will support single line breaks [...] think this is the most intuitive format, especially for non-technical users (the target audience)
100% agree on this. I've been using Commonmark on a few projects, and it's served me well. Like you, I hate how it handles single line breaks though.
from simplemde-markdown-editor.
Related Issues (20)
- Potential security issue
- Feature request: split side by side preview horizontally
- Uncaught TypeError: marked.setOptions is not a function HOT 3
- is this project still maintained? (or 5-years abandoned?) HOT 2
- Can't hide and toggle fullscreen or side-by-side HOT 1
- I am using simplemde editor and convert it into html but the value of simplemde.value() is null
- How do I render the headings inside a div?
- Strikethrough does not work
- Is this the right Homepage for this package?
- Edit image src on Preview mode
- Scrollable Textarea HOT 1
- Change language
- Pink highlights on uncommon words HOT 1
- Changing font size for .editor-preview
- Adding starter text - how do I make custom 'default' text editable?
- Broken with middlemouse.contentLoadURL=true
- How to turn on active links in edit mode?
- SimpleMDE with LaTeX feature by default?
- Disable preview rendering in writing mode HOT 2
- Odd borders showing up when included in PWA HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simplemde-markdown-editor.