# Is it possible to insert HTML code in Markdown content?

**URL:** <https://discourse.gohugo.io/t/is-it-possible-to-insert-html-code-in-markdown-content/4867>\
**Category:** support\
**Created:** [December 20, 2016, 7:16am UTC](https://discourse.gohugo.io/t/is-it-possible-to-insert-html-code-in-markdown-content/4867 "2016-12-20T07:16:14Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Billy\_Herrington](https://avatars.discourse-cdn.com/v4/letter/b/e68b1a/32.png) [@Billy\_Herrington](https://discourse.gohugo.io/u/Billy_Herrington)\
**Post date:** [December 20, 2016, 7:16am UTC](https://discourse.gohugo.io/t/is-it-possible-to-insert-html-code-in-markdown-content/4867/1 "2016-12-20T07:16:15Z")

</div>

Does Hugo’s markdown engine support this feature? I haven’t got any clue on its documentation site. Any workarounds will be appreciated.

---

<div class="post-metadata">

**Author:** ![willstar](https://avatars.discourse-cdn.com/v4/letter/w/ce7236/32.png) [@willstar](https://discourse.gohugo.io/u/willstar)\
**Post date:** [December 20, 2016, 8:45am UTC](https://discourse.gohugo.io/t/is-it-possible-to-insert-html-code-in-markdown-content/4867/2 "2016-12-20T08:45:49Z")

</div>

You can add html inside markdown files in /content. However your indented code will follow markdown formatting. You could also save your content files as .html but then you’ll have to write everything in html.

---

<div class="post-metadata">

**Author:** ![budparr](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/budparr/32/749_2.png) [@budparr](https://discourse.gohugo.io/u/budparr)\
**Post date:** [December 20, 2016, 1:04pm UTC](https://discourse.gohugo.io/t/is-it-possible-to-insert-html-code-in-markdown-content/4867/3 "2016-12-20T13:04:48Z")

</div>

You can typically use HTML in Markdown. Hugo’s Markdown processor, [Blackfriday](https://github.com/russross/blackfriday) merely adds a superset of functionality on top of Markdown. Hugo also has shortcodes that you can create (as well as some built-in) that might help too: [https://gohugo.io/extras/shortcodes/](https://gohugo.io/extras/shortcodes/)

---

<div class="post-metadata">

**Author:** ![rdwatters](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rdwatters/32/2848_2.png) [@rdwatters](https://discourse.gohugo.io/u/rdwatters)\
**Post date:** [December 20, 2016, 4:32pm UTC](https://discourse.gohugo.io/t/is-it-possible-to-insert-html-code-in-markdown-content/4867/4 "2016-12-20T16:32:37Z")

</div>

@Billy_Herrington HTML can be part of markdown because HTML-inside-markdown is part of the spec. That said, remember that the spec disallows markdown nested inside of HTML. So if you create a div, just make sure everything inside that div is valid HTML. To echo @budparr, if you find yourself repeating blocks of HTML, it’s worth it to check out shortcodes.

---

<div class="post-metadata">

**Author:** ![Ross\_Larson](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/ross_larson/32/4094_2.png) [@Ross\_Larson](https://discourse.gohugo.io/u/Ross_Larson)\
**Post date:** [September 8, 2017, 2:20am UTC](https://discourse.gohugo.io/t/is-it-possible-to-insert-html-code-in-markdown-content/4867/5 "2017-09-08T02:20:54Z")

</div>

I inserted some HTML from Tableau Public into a post, and although I was eventually able to make it appear in the post, I noticed that the Recent Posts page shows the html as text. Is this expected?

Code: [https://github.com/Leagify/quicktest/blob/master/content/posts/my-first-post.md#](https://github.com/Leagify/quicktest/blob/master/content/posts/my-first-post.md#)

Site: [https://leagify.github.io/quicktest/](https://leagify.github.io/quicktest/)

---

<div class="post-metadata">

**Author:** ![bmackinney](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bmackinney/32/2202_2.png) [@bmackinney](https://discourse.gohugo.io/u/bmackinney)\
**Post date:** [September 8, 2017, 3:14pm UTC](https://discourse.gohugo.io/t/is-it-possible-to-insert-html-code-in-markdown-content/4867/6 "2017-09-08T15:14:58Z")

</div>

@Ross_Larson yes. The layout file responsible is: [themes/ananke/layouts/post/summary.html](https://github.com/budparr/gohugo-theme-ananke/blob/a3dc1ac327c2c8c97e44168db7006b7f3c375917/layouts/post/summary.html)

`{{ .Summary }}` strips all HTML tags.

See [https://gohugo.io/content-management/summaries/](https://gohugo.io/content-management/summaries/)

Create your own `layouts/post/summary.html` file to override the theme default.

---

<div class="post-metadata">

**Author:** ![Hakeemmidan](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/hakeemmidan/32/12667_2.png) [@Hakeemmidan](https://discourse.gohugo.io/u/Hakeemmidan)\
**Post date:** [March 19, 2020, 7:10am UTC](https://discourse.gohugo.io/t/is-it-possible-to-insert-html-code-in-markdown-content/4867/7 "2020-03-19T07:10:26Z")

</div>

I think this answers your question: [https://anaulin.org/blog/hugo-raw-html-shortcode/](https://anaulin.org/blog/hugo-raw-html-shortcode/)

---

<div class="post-metadata">

**Author:** ![alexandros](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@alexandros](https://discourse.gohugo.io/u/alexandros)\
**Post date:** [March 19, 2020, 7:39am UTC](https://discourse.gohugo.io/t/is-it-possible-to-insert-html-code-in-markdown-content/4867/8 "2020-03-19T07:39:14Z")

</div>


