My primary website uses Hugo for a variety of reasons and for the most part, I love it…except when you run into odd edge-cases and the latest one: line-breaks using Markdown aka the <br /> tag.

After a little bit of research, I ended up creating a custom shortcode to handle the need / issue, naming it “line-break.html”:

List of html files under the layouts / shortcodes directory structure.

To use the shortcode, I add [[< line-break >]] (I used regular brackets here, instead of curly ones, so this shortcode wouldn’t trip up Hugo) into my various markdown files and voila: line-breaks in the generated HTML!

Screen grab of text, showing the newly created line-break tag at the end of each line.