EpicEditor
EpicEditor copied to clipboard
Automatically add breaks on the line end
In order to keep the plain text readable also on wide screens, markdown has this nice logic of ignoring brakes at parsing. So that the user is able to add breaks by himself. Here this could work automatically. So on writing it should constantly check how long the line is and if its too long, it should add a linebreak(+indention) before that last word.
For this it would be necessary to add a line length limit as a configurable variable. For example this has a line length limit of 30 (which is very low):
Lorem ipsum dolor
sit amet, consectetuer
adipiscing elit, sed
diam nonummy nibh
euismod tincidunt ut
laoreet dolore magna
aliquam erat volutpat.
* Ut wisi enim ad minim
veniam, quis nostrud
exerci tation
ullamcorper suscipit
lobortis nisl ut
aliquip ex ea commodo
consequat.
* Duis autem vel eum
iriure dolor in
hendrerit in
vulputate velit esse
molestie consequat.
Note: This should not affect links or it should convert links into 'reference style'
Couldnt you simply add some padding or margin on the editor to achieve the same result?
Here's an example where I just changed the body width to 350px
:
Is your main concern long links with this?
That only affects the presentation. The actual text has no css ^^
Yes, absolutely. Why would you want the actual code to have breaks in it? I'm only asking to better understand the use case.
To make it readable 'as it is'. for example you want to copy and paste it to an email or you save it in a text file or in a database
Awh yes. That makes sense. Great use case. I'll add this to my list :)
Wouldn't that be do-able with Marked's option to use GFM-style breaks? I was going to add an issue to allow passing options through to Marked, but since I wanted it for this specific purpose, will just add my $0.02 here.
Poetry is another use case, for this.
@dethe not sure I understand. Yeah, you can totally make these breaks yourself if you wanted. @fuddl wanted these breaks to happen automatically.
I thought he wanted existing linebreaks to be honored, which GFM does, but original Markdown doesn't. In Markdown you have to end a line with two or more spaces to get a linebreak, which is terrible usability since it is not visible, and takes a fair amount of typing to get the behaviour of "just keep what I have already."
Marked does this already, but it is not the default, you have to pass an option to it. I see in your (very nice) docs how to replace Marked with a different Markdown parser, but not how to pass arguments through to Marked.
...on writing it should constantly check how long the line is and if its too long, it should add a linebreak(+indention) before that last word.
I think that's the tl;dr version of the ticket. :) there's a few tickets regarding pasting tho. In https://github.com/OscarGodson/EpicEditor/issues/308 @W4RH4WK makes a suggestion about turning off our HTML paste cleaner which i think is a good idea.
Ah, I see. I'll add a different ticket for my issue then. Thanks for the clarification.