# Shortcode adds newline

**URL:** <https://discourse.gohugo.io/t/shortcode-adds-newline/44788>\
**Category:** support\
**Tags:** shortcodes\
**Created:** [June 14, 2023, 1:32am UTC](https://discourse.gohugo.io/t/shortcode-adds-newline/44788 "2023-06-14T01:32:50Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![bwintx](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bwintx/32/10450_2.png) [@bwintx](https://discourse.gohugo.io/u/bwintx)\
**Post date:** [June 14, 2023, 3:03am UTC](https://discourse.gohugo.io/t/shortcode-adds-newline/44788/2 "2023-06-14T03:03:55Z")

</div>

Turns out there’s an interesting fix to this:

> [@Markdown render hooks extra space](https://discourse.gohugo.io/t/markdown-render-hooks-extra-space/27446/5):
>
> Yes, and as @pamubay pointed out, it ends with a newline character. If your file did not end with a newline character, the following command would display the \> character: tail -c 1 layouts/\_default/\_markup/render-link.html Instead, the above command produced a blank line, indicating that your file ends with a newline character. Add this at the end of your file to consume the newline: {{- /\* This comment removes trailing newlines. \*/ -}}

---

_[View the full topic](https://discourse.gohugo.io/t/shortcode-adds-newline/44788)._
