# Shortcode markdown not rendering correctly

**URL:** <https://discourse.gohugo.io/t/shortcode-markdown-not-rendering-correctly/14145>\
**Category:** support\
**Created:** [September 10, 2018, 1:20pm UTC](https://discourse.gohugo.io/t/shortcode-markdown-not-rendering-correctly/14145 "2018-09-10T13:20:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![calvinfu1128](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/calvinfu1128/32/6877_2.png) [@calvinfu1128](https://discourse.gohugo.io/u/calvinfu1128)\
**Post date:** [September 10, 2018, 1:20pm UTC](https://discourse.gohugo.io/t/shortcode-markdown-not-rendering-correctly/14145/1 "2018-09-10T13:20:24Z")

</div>

Sorry if this question is too basic, I have not been able to locate same question here or at Google

What I did is super simple, just 3 files

index.html file under layouts folder has this  
`{{ .Content }}`

newshortcode.html sitting under layouts/shortcodes folder has this  
`{{ .Inner }}`

And finally `_index.md` under content folder has the content below

```
---
title: "Home Page"
date: 2018-09-09T17:52:20+08:00
draft: true
---

{{% newshortcode %}}
**this is the text inside shortcode tags**
{{% /newshortcode %}}`

```

I would expect with using {{% I should see the text between those \*\* be bold, however I got  
` **this is the text inside shortcode tags** `

And when I inspect this element at browser,  
`<pre><code> **this is the text inside shortcode tags** </code></pre>` is what it rendered

Could anyone please advise what I did wrongly?

Many thanks

Calvin

---

<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:** [September 10, 2018, 1:27pm UTC](https://discourse.gohugo.io/t/shortcode-markdown-not-rendering-correctly/14145/2 "2018-09-10T13:27:19Z")

</div>

> [@calvinfu1128](#):
>
> draft: true

First undraft your `_index.md`. Is the behavior still the same?

If yes, then please share a link to the source of your project.

---

<div class="post-metadata">

**Author:** ![calvinfu1128](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/calvinfu1128/32/6877_2.png) [@calvinfu1128](https://discourse.gohugo.io/u/calvinfu1128)\
**Post date:** [September 10, 2018, 1:57pm UTC](https://discourse.gohugo.io/t/shortcode-markdown-not-rendering-correctly/14145/3 "2018-09-10T13:57:03Z")

</div>

[https://github.com/calvinfu1128/shortcode-markdown](https://github.com/calvinfu1128/shortcode-markdown)

draft: false does not help

And I pasted the codes that I got, thanks

---

<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:** [September 10, 2018, 2:27pm UTC](https://discourse.gohugo.io/t/shortcode-markdown-not-rendering-correctly/14145/4 "2018-09-10T14:27:25Z")

</div>

Now just a minute, you cannot have only `{{ .Content }}` in your `index.html` template and expect to get a valid HTML page in the browser.

Please have a look at the repository of the [Ananke theme](https://github.com/budparr/gohugo-theme-ananke) that is used in the [Quick Start Guide](https://gohugo.io/getting-started/quick-start/) to see how you need to structure your Hugo project templates for valid HTML.

---

<div class="post-metadata">

**Author:** ![pointyfar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/pointyfar/32/5797_2.png) [@pointyfar](https://discourse.gohugo.io/u/pointyfar)\
**Post date:** [September 11, 2018, 3:34am UTC](https://discourse.gohugo.io/t/shortcode-markdown-not-rendering-correctly/14145/5 "2018-09-11T03:34:30Z")

</div>

Hi,

In addition to making sure you have valid HTML, you also need to be careful with spaces or indents in your content. I noticed your text is indented by 8 spaces; Markdown interprets 4-space indent as ‘this is a code block’.

---

<div class="post-metadata">

**Author:** ![calvinfu1128](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/calvinfu1128/32/6877_2.png) [@calvinfu1128](https://discourse.gohugo.io/u/calvinfu1128)\
**Post date:** [September 11, 2018, 3:44am UTC](https://discourse.gohugo.io/t/shortcode-markdown-not-rendering-correctly/14145/6 "2018-09-11T03:44:44Z")

</div>

Thanks @alexandros, I had my own theme in another hugo project that I created for learning purpose, markdown was not working and so I created a simple version for troubleshooting, but thanks for raising this up =)

---

<div class="post-metadata">

**Author:** ![calvinfu1128](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/calvinfu1128/32/6877_2.png) [@calvinfu1128](https://discourse.gohugo.io/u/calvinfu1128)\
**Post date:** [September 11, 2018, 3:45am UTC](https://discourse.gohugo.io/t/shortcode-markdown-not-rendering-correctly/14145/7 "2018-09-11T03:45:41Z")

</div>

thanks a lot @pointyfar, indentation is the cause, it is now working  
newbie mistake =)
