<p>I was able to get good results using <code>{{ block.myFieldName|nl2br|markdown }}</code></p>

CC BY-SA 3.0
2017-08-11T22:23:44.447Z
2017-08-11T22:23:44.447Z
SoHo
<p>There is a Craft <a href="https://github.com/pixelandtonic/Parsedown" rel="nofollow noreferrer">Parsedown</a> plugin for Craft which supports Github Flavored Markdown you can use.</p>

CC BY-SA 3.0
2017-07-21T17:27:44.757Z
2017-07-21T17:27:44.757Z
Brad Bell
<p>In particular, I'm trying to render the text in markdown preserving the original line breaks, like in the GitHub Flavored Markdown specifications.</p>

<p>Using <code>{{ something | md }}</code> in a template the output contains a line break only if a line ends with two spaces, like in the original markdown implementation.</p>

<p>Some markdown processors (ie Blackfriday, written in Go) call this feature "hardLineBreak".</p>

<markdown>
Render markdown as GFM (GitHub Flavored Markdown), therefore preserving line breaks?
# Render markdown as GFM (GitHub Flavored Markdown), therefore preserving line breaks?

(Asked by: username_0 on 2017-07-21)

In particular, I'm trying to render the text in markdown preserving the original line breaks, like in the GitHub Flavored Markdown specifications.

Using `{{ something | md }}` in a template the output contains a line break only if a line ends with two spaces, like in the original markdown implementation.

Some markdown processors (ie Blackfriday, written in Go) call this feature "hardLineBreak".

**Tags:** markdown


---

## 2 answers

### Answer by username_1 on 2017-08-11. Score: 2 | Accepted answer

I was able to get good results using `{{ block.myFieldName|nl2br|markdown }}`


---

### Answer by username_2 on 2017-07-21. Score: 1

There is a Craft [Parsedown](https://github.com/pixelandtonic/Parsedown) plugin for Craft which supports Github Flavored Markdown you can use.


---

