<p>Have a look at the <a href="https://github.com/pixelandtonic/Parsedown" rel="noreferrer">Parsedown</a> plugin by P&amp;T, it provides a line mode to not output any wrapping <code>&lt;p&gt;</code> tags.</p>

<pre><code>{{ entry.title|parsedown('line') }}
</code></pre>

CC BY-SA 3.0
2016-04-21T15:44:24.953Z
2016-04-21T15:44:24.953Z
carlcs
<p>If you're here looking for a Craft 3 answer, the <a href="https://wordsmith.docs.topshelfcraft.com/guide/markdown.html#markdown" rel="noreferrer">Wordsmith plugin</a> offers the same ability to only parse inline and not include paragraph tags:</p>

<pre><code>{{ entry.title|markdown(inlineOnly=true) }}
</code></pre>

CC BY-SA 4.0
2020-12-13T14:27:21.133Z
As of Craft 3.5, the inlineOnly directive works with core too
Urs
CC BY-SA 4.0
2019-02-19T06:51:11.643Z
2019-02-19T06:51:11.643Z
Matt Stein
<p>Is there a way to parse a line of Markdown within Twig – without the surrounding 
<code>&lt;p&gt;</code> tags?</p>

<p>I see there is a StringHelper method called <a href="https://craftcms.com/classreference/helpers/StringHelper#parseMarkdownLine-detail" rel="noreferrer">ParseMarkdownLine</a> that does exactly what I'd like, but I haven't found a way to invoke it in my templates.</p>

CC BY-SA 3.0
2016-04-21T11:50:41.473Z
`{{ item | markdown | replace('<p>','') | replace('</p>','') | raw }}` works for a single line, but it does not feel right.
Avant la lettre
<templating><markup><markdown>
Parse a line of Markdown, without <p>
# Parse a line of Markdown, without <p>

(Asked by: username_0 on 2016-04-21)

Is there a way to parse a line of Markdown within Twig – without the surrounding
 tags?

I see there is a StringHelper method called [ParseMarkdownLine](https://craftcms.com/classreference/helpers/StringHelper#parseMarkdownLine-detail) that does exactly what I'd like, but I haven't found a way to invoke it in my templates.

**Tags:** templating, markup, markdown
> **Comments:**
> **username_0**: `{{ item | markdown | replace('<p>','') | replace('</p>','') | raw }}` works for a single line, but it does not feel right.  

---

## 2 answers

### Answer by username_2 on 2019-02-19. Score: 6 | Accepted answer

If you're here looking for a Craft 3 answer, the Wordsmith plugin offers the same ability to only parse inline and not include paragraph tags:
{{ entry.title|markdown(inlineOnly=true) }}

> **Comments:**
> **username_3**: As of Craft 3.5, the inlineOnly directive works with core too  

---

### Answer by username_1 on 2016-04-21. Score: 6

Have a look at the Parsedown plugin by P&T, it provides a line mode to not output any wrapping  tags.
{{ entry.title|parsedown('line') }}


---

