# Adding code within numbered list

**URL:** <https://discourse.gohugo.io/t/adding-code-within-numbered-list/21146>\
**Category:** support\
**Created:** [October 6, 2019, 5:39pm UTC](https://discourse.gohugo.io/t/adding-code-within-numbered-list/21146 "2019-10-06T17:39:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![manish\_bansal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/manish_bansal/32/9711_2.png) [@manish\_bansal](https://discourse.gohugo.io/u/manish_bansal)\
**Post date:** [October 6, 2019, 5:39pm UTC](https://discourse.gohugo.io/t/adding-code-within-numbered-list/21146/1 "2019-10-06T17:39:18Z")

</div>

I have a numbered list. I want to add code segments within the list. Now, i tried 2 ways.

First, like below.

````
1. First line

```shell
cat abc.txt
cat efg.txt
```

2. Second line

````

In this case, my numbering gets restarted. However, my code is properly formatted.

In second case, if i intend my code section by tabs, numbering remains correct, but unnecessary line spacing gets added into my code section.

Second, like below.

````
1. First line

    ```shell
    cat abc.txt
    cat efg.txt
    ```

2. Second line
````

---

<div class="post-metadata">

**Author:** ![ju52](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/ju52/32/6749_2.png) [@ju52](https://discourse.gohugo.io/u/ju52)\
**Post date:** [October 7, 2019, 6:44am UTC](https://discourse.gohugo.io/t/adding-code-within-numbered-list/21146/2 "2019-10-07T06:44:28Z")

</div>

try

```
<pre class="preclass">
shell
cat abc.txt
cat efg.txt
</pre>

```

then define **preclass** CSS to get the text inline

---

<div class="post-metadata">

**Author:** ![maiki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/maiki/32/16384_2.png) [@maiki](https://discourse.gohugo.io/u/maiki)\
**Post date:** [October 8, 2019, 2:23am UTC](https://discourse.gohugo.io/t/adding-code-within-numbered-list/21146/3 "2019-10-08T02:23:32Z")

</div>

Markdown is for simple stuff, your use case is kinda complicated, so it won’t be supported across the board. In your case, use HTML. 🙂
