bevacqua / woofmark

:dog2: Barking up the DOM tree. A modular, progressive, and beautiful Markdown and HTML editor
https://bevacqua.github.io/woofmark
MIT License
1.62k stars 74 forks source link

Disappearing line-break #1

Closed thgh closed 9 years ago

thgh commented 9 years ago

Bug: The position of the cursor at the moment of switching the view changes the behaviour of the parser.

How to reproduce:

  1. Open markdown view
  2. Set cursor at the end of a line ending in 2 spaces (this should parse to a line-break)
  3. Open html or wysiwyg view
  4. Line-break is not applied
  5. Open markdown view: the 2 spaces are reduced to 1 space

A case in which the bug does not come up:

  1. Open markdown view
  2. Set cursor not at the end of a line ending in 2 spaces (this should parse to a line-break)
  3. Open html or wysiwyg view
  4. Line-break is applied as expected
  5. Open markdown view: the 2 spaces are still there as expected
bevacqua commented 9 years ago

That's as per Markdown spec. You are free to use another markdown compiler

styfle commented 9 years ago

@bevacqua Which markdown compiler are you using? Can you expose the options to the compiler? Most support a flag for soft or hard breaks.

bevacqua commented 9 years ago

See: https://github.com/bevacqua/woofmark#optionsparsemarkdown. You're free to not use megamark, configure it however you want, or use something else.

thgh commented 9 years ago

I updated the issue to better explain the bug report.