When using a shortcode in a Markdown file, a space is automatically inserted after the shortcode output in the rendered HTML output.
The most basic example is a shortcode that is defined simply as “some text”. Calling the shortcode with a period afterwards in the Markdown file — {% shortcode %}.
— results in “some text .” in the HTML output (note the space between the shortcode output and the subsequent period).
Because it appears that Hugo doesn’t support using templates directly in the Markdown files (unlike Liquid templates in Jekyll), I planned on using shortcodes to include site parameters and apply conditional logic in the Markdown content.
In addition, I want to use shortcodes to apply custom text-formatting styles such as “func” or “filename”.
These implementations seem to work well except for the extra space issue, which is critical.