Automattic / simplenote-android

Simplenote for Android
https://simplenote.com
GNU General Public License v2.0
1.77k stars 299 forks source link

Markdown Preview Not Respecting Line Breaks #1542

Open mdrockwell opened 2 years ago

mdrockwell commented 2 years ago

Expected

When previewing a note, text separated by a single line break should be displayed on separate lines.

Observed

When previewing a note, text separated by a single line break is displayed on the same line.

Reproduced

  1. Create a new note with markdown enabled.
  2. Add text to the note with a single line break.
  3. Switch to preview.

Screenshot_20220321-100840 Screenshot_20220321-100848

Tested on: Device Make: Google Device Model: Pixel 3 Android Version: 12 Simplenote Version: 2.23

peril-automattic[bot] commented 2 years ago
Fails
:no_entry_sign: Please add a type label to this issue. e.g. '[Type] Enhancement'
:no_entry_sign: Please add a feature label to this issue. e.g. 'Stats'

Generated by :no_entry_sign: dangerJS

ndesgranges commented 2 years ago

I think this is expected from official Markdown site:

The implication of the “one or more consecutive lines of text” rule is that Markdown supports “hard-wrapped” text paragraphs. This differs significantly from most other text-to-HTML formatters (including Movable Type’s “Convert Line Breaks” option) which translate every line break character in a paragraph into a
tag.

Please note this behaviour is sometimes changed by some markdown flavours or renderers

Here sample code:

Writing some text
On multiple lines ends up rendering a
Single line

Though, you can break a line with multiple 

Line breaks

Which would give :

Writing some text On multiple lines ends up rendering a Single line

Though, you can break a line with multiple

Line breaks