elm-explorations / markdown

Markdown parser available for historical reasons. Will be replaced when we have an Elm implementation!
BSD 3-Clause "New" or "Revised" License
30 stars 3 forks source link

New lines at the end of code blocks are being removed #4

Open amilner42 opened 5 years ago

amilner42 commented 5 years ago

New lines at the end of code blocks are being removed.

If you check github code blocks for instance, they are not removed, just like the code in this very markdown:

a = 5

To reproduce, simply try adding some new lines at the end such as:

import Markdown

...

view =
  Markdown.toHtml
            []
            """```javascript
            a = 5
        """


And you will get the following:

<img width="604" alt="image" src="https://user-images.githubusercontent.com/9031171/59314515-7f334800-8c6a-11e9-8519-0063fced6416.png">

NOTE that it chopped off all the final empty newlines.