Git Product home page Git Product logo

Comments (7)

WesCossick avatar WesCossick commented on May 18, 2024

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.

jesseleite avatar jesseleite commented on May 18, 2024

@WesCossick: I'm confused because GFM handles single line breaks the same way.

GFM

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.

WesCossick avatar WesCossick commented on May 18, 2024

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.

jesseleite avatar jesseleite commented on May 18, 2024

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.

jesseleite avatar jesseleite commented on May 18, 2024

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.

WesCossick avatar WesCossick commented on May 18, 2024

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.

jesseleite avatar jesseleite commented on May 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.