# Extra newline after \<code\> with Mkdown

**URL:** https://discourse.notenik.app/t/extra-newline-after-code-with-mkdown/485
**Category:** Uncategorized
**Created:** [May 30, 2024, 2:19am UTC](https://discourse.notenik.app/t/extra-newline-after-code-with-mkdown/485 "2024-05-30T02:19:48Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![jld](https://discourse.notenik.app/letter_avatar_proxy/v4/letter/j/51bf81/32.png) [@jld](https://discourse.notenik.app/u/jld)
#### Post date: [May 30, 2024, 2:19am UTC](https://discourse.notenik.app/t/extra-newline-after-code-with-mkdown/485/1 "2024-05-30T02:19:48Z")

</div>

Well, this took longer to figure out than it seems in hindsight like it should have, but when using the Mkdown processor, I get extra vertical space above a code block.

It turns out that the cause is a newline following the opening code tag, which makes sense.

Not sure what happens in this forum if I include actual tags in the text, so I guess I’ll try and see. Using the Mkdown processor, the HTML for a code block looks like this:

```

code block here

```

Since the newline following the opening code tag is inside a pre block, it is interpreted literally, or so I surmise anyway. The visual result when rendered is an extraneous blank line above the code block.

This does not happen with the Down or Ink processors, which both place the first line of the code block on the same line as the opening code tag. When rendered, this produces the correct visual result.

---

<div class="post-metadata">

### Author: ![jld](https://discourse.notenik.app/letter_avatar_proxy/v4/letter/j/51bf81/32.png) [@jld](https://discourse.notenik.app/u/jld)
#### Post date: [May 30, 2024, 2:22am UTC](https://discourse.notenik.app/t/extra-newline-after-code-with-mkdown/485/2 "2024-05-30T02:22:57Z")

</div>

OK, it turns out that tags in messages here are interpreted as tags. But in my previous message, you can see the result of the extraneous newline after the opening code tag. Notice that the top of the background color is one line above the first line of the code block. This is exactly the extra vertical space I was trying to describe.

---

<div class="post-metadata">

### Author: ![jld](https://discourse.notenik.app/letter_avatar_proxy/v4/letter/j/51bf81/32.png) [@jld](https://discourse.notenik.app/u/jld)
#### Post date: [May 30, 2024, 2:41am UTC](https://discourse.notenik.app/t/extra-newline-after-code-with-mkdown/485/3 "2024-05-30T02:41:39Z")

</div>

Forgot to mention this, but while inspecting HTML exported from Notenik, I noticed that there is never a closing body tag. Doesn’t matter which markdown processor is used.

This doesn’t cause any problems but does seem like an oversight.

---

<div class="post-metadata">

### Author: ![hbowie](https://discourse.notenik.app/user_avatar/discourse.notenik.app/hbowie/32/6_2.png) [@hbowie](https://discourse.notenik.app/u/hbowie)
#### Post date: [May 30, 2024, 4:24pm UTC](https://discourse.notenik.app/t/extra-newline-after-code-with-mkdown/485/4 "2024-05-30T16:24:00Z")

</div>

Thanks for reporting. Let me look into this.

---

<div class="post-metadata">

### Author: ![hbowie](https://discourse.notenik.app/user_avatar/discourse.notenik.app/hbowie/32/6_2.png) [@hbowie](https://discourse.notenik.app/u/hbowie)
#### Post date: [May 31, 2024, 12:19am UTC](https://discourse.notenik.app/t/extra-newline-after-code-with-mkdown/485/5 "2024-05-31T00:19:27Z")

</div>

Thanks for reporting both of these issues! I believe they should be fixed in the [latest beta](https://discourse.notenik.app/t/notenik-14-5-4-available-for-beta-testing-on-may-30th-2024/488).

---

<div class="post-metadata">

### Author: ![jld](https://discourse.notenik.app/letter_avatar_proxy/v4/letter/j/51bf81/32.png) [@jld](https://discourse.notenik.app/u/jld)
#### Post date: [May 31, 2024, 12:41am UTC](https://discourse.notenik.app/t/extra-newline-after-code-with-mkdown/485/6 "2024-05-31T00:41:12Z")

</div>

Thanks Herb! This does indeed fix the problem with code tags that I reported and the results look good. I’m really grateful for your quick responses.
