Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for line breaks #40

Open
KevinTheGray opened this issue Mar 29, 2018 · 8 comments

Comments

@KevinTheGray
Copy link
Contributor

commented Mar 29, 2018

Maybe I'm missing something, but I don't see a way to add line breaks where wanted. A lot of Markdown supports this with the following rule: "To force a line return, place two empty spaces at the end of a line."

I can get a maximum of one new line, after that, they seem to collapse. I'd like to have something like

Hello
  
  
  
There are three lines of space above this
@DaveShuckerow

This comment has been minimized.

Copy link

commented Apr 6, 2018

Hi Kevin, thanks for noticing this!

This is reproducible at http://dart-lang.github.io/markdown/, so the root cause is the underlying Dart markdown library.

I suggest filing this issue there. Link: https://github.com/dart-lang/markdown/issues

@KevinTheGray

This comment has been minimized.

Copy link
Contributor Author

commented Apr 9, 2018

Ok thanks @DaveShuckerow, will do

@srawlins

This comment has been minimized.

Copy link

commented Apr 9, 2018

I don't see any empty spaces at the end of the line. Just empty lines.

@KevinTheGray

This comment has been minimized.

Copy link
Contributor Author

commented Apr 9, 2018

@srawlins what are you referring to? the example i posted?

@srawlins

This comment has been minimized.

Copy link

commented Apr 9, 2018

Sorry, better conversation over at dart-lang/markdown#214.

@KevinTheGray

This comment has been minimized.

Copy link
Contributor Author

commented Apr 10, 2018

@DaveShuckerow it looks like the spec that http://dart-lang.github.io/markdown/ uses is called CommonMark, found here: http://spec.commonmark.org/0.28/#hard-line-breaks.

Line breaks with this spec is done as in the following image:

screen shot 2018-04-10 at 4 59 35 pm

You cant test that here: https://dart-lang.github.io/markdown/

I tested the result of markdownToHtml in the dart-lang markdown package, as follows

String html = markdownToHtml('hello\\\n\\\n\\\n\\\nthere are three breaks above this line');

which results in the following HTML

<p>hello<br />
<br />
<br />
<br />
there are three breaks above this line</p>

So I believe the dart-lang plugin in behaving as intended with the proper syntax. However, the flutter plugin does not seem to respect the <br /> tags.

So I believe this is a flutter-markdown plugin issue now that I've learned the proper syntax for CommonMark.

@michaldrabina michaldrabina referenced this issue Apr 17, 2018
@xster

This comment has been minimized.

Copy link
Contributor

commented Jun 22, 2018

cc @mit-mit :)

@mit-mit

This comment has been minimized.

Copy link
Member

commented Jun 25, 2018

I'd be happy to review a PR for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.