question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

text\ntext not parsed correctly

See original GitHub issue

Hello, thank you for this amazing library! I really love it!

While I was using it, I found a small bug where the \n character is not rendered correctly. When I did Markwon.setMarkdown(textView, "haha\ngaga");, the outcome looks like this:

image

Where I would expect there’s a newline between “haha” and “gaga”. Could anyone show me how to fix this? Greatly appreciated!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
notiescommented, Aug 1, 2018

Hello @DSofter !

Thank you for your feedback! About the new line - yeah, it’s not that it’s parsed incorrectly. The thing is one new line (\n) character in markdown (according to the spec) is considered a soft line break. Currently Markwon does not provide a way to configure it (treat a soft line break as a hard one). But now I’m planning to add it to the next release. Meanwhile you can follow the generic advice from here (#20) and override visit(SoftLineBreak softLineBreak) to insert a \n character instead.

Also, you could try haha\n\ngaga and it will be rendered like you expect (double new line characters)

🙌

0reactions
DSoftercommented, Aug 8, 2018

@noties I tried. Works like a charm!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Full Text not parsing a specific term correctly - Microsoft Q&A
Full Text not parsing a specific term correctly. Adding the term "RON 1376" or RON in uppercase followed by a numeric value will...
Read more >
Text could not be parsed, unparsed text found - Stack Overflow
The first time passes perfectly but anyone after that causes the error. They both have the exact same format with no whitespace on...
Read more >
Jsdoc https @link text not parsed properly #46734 - GitHub
Using TypeScript v4.3.5 , everything works fine. I do not understand why the JSDoc implementation on VSCode is dependent of TypeScript version ...
Read more >
Newline \n not parsing correctly - TextMesh Pro - Unity Forum
A simple hand typed \n into the public string variable test 2. Under both conditions a breakpoint showed \\n as the character and...
Read more >
IO tools (text, CSV, HDF5, …) — pandas 1.5.2 documentation
Some formats which encode all characters as multiple bytes, like UTF-16, won't parse correctly at all without specifying the encoding.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found