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

Markdown doesn't render correctly on Android when a line ends with two spaces followed by a newline. #215

Open
12 tasks done
komatao opened this issue Oct 3, 2024 · 2 comments

Comments

@komatao
Copy link

komatao commented Oct 3, 2024

About this issue

Markdown doesn't render correctly on Android when a line ends with two spaces followed by a newline.

Based on the markdown syntax, two space and a newline should be represented as a line break.

But it has been rendered three line breaks in this library.

I've went though the code and it seems the parsing isn’t accurate.
For instance, take the string "abc \n" where there are two spaces after "abc".
After parsing, the output incorrectly includes the elements TEXT, BR, and EOL.

And according the logic here, the BR will be translated to two '\n'. As a result, the render will not be as expected.

btw, if we have a string like "abc \n".(one spaces after abc).
After parsing, the output includes the children like TEXT/WHITESPACE/EOL.

Could some one help check on this issue?

Details

  •  Used library version
    0.26.0
  •  Used platform
    android
  •  Used support library version
  •  Used gradle build tools version
  •  Used tooling / Android Studio version
  •  Other used libraries, potential conflicting libraries

Checklist

@mikepenz
Copy link
Owner

mikepenz commented Nov 1, 2024

Thank you for the report.

Can you provide a few sample markdowns with various combinations? This would help a great deal to look into this more.

@komatao
Copy link
Author

komatao commented Nov 6, 2024

@mikepenz

Thanks for the response.

Here is one example,

"**Aug 24, 2023** \n6:00 AM - 7:00 AM MST \n8:00 AM - 8:30 AM MST\n\n**Aug 28, 2023** \n8:00 AM - 8:30 AM MST\n\n**Aug 30, 2023** \n8:00 AM - 8:30 AM MST \n11:00 AM - 12:00 PM MST \n"

There are two spaces after **Aug 24, 2023**, followed by a line break.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants