Hi all.
I’ve just created my first site and I’ve been pleasantly surprised with Hugo’s customization options. Thanks a lot for this wonderful SSG!
There’s one little issue that I can’t seem to figure out, hopefully somebody can point me in the right direction.
I’m using the hugo-profile theme, but I’m unsure of whether this is an issue with the theme, markdown or (most probably) me Here’s my problem:
In one of my single pages, I’m simply hosting a privacy policy agreement, which I keep in a simple Markdown document. For the record, I was using this exact same Markdown document with a Jekyll site in the past, with none of these issues.
The privacy policy contains some unnumbered lists, and because they’re a bit verbose, I want to leave a blank line in between list items, like this:
For the purposes of this Privacy Policy:
- **Account** means a unique account created for You to access our Service or parts of our Service
- **Affiliate** means an entity that controls, is controlled by or is under common control with a party, where "control" means ownership of 50% or more of the shares, equity interest or other securities entitled to vote for election of directors or other managing authority.
I’m a new user so I’m not allowed to upload more than one screenshot, but you can guess what the expected look was: blank lines in-between each list item (which is what it looked like in Jekyll).
However, this is what I’m getting with Hugo:
Looks the same in both Firefox and Chrome, and it also happens with numbered lists.
As you can see, a line break is being inserted in-between the list symbol and the line content.
If I take a look at the actual HTML that is produced, this is what it looks like:
<p>For the purposes of this Privacy Policy:</p>
<ul>
<li>
<p><strong>Account</strong> means a unique account created for You to access our Service or parts of our Service</p>
</li>
<li>
<p><strong>Affiliate</strong> means an entity that controls, is controlled by or is under common control with a party, where “control” means ownership of 50% or more of the shares, equity interest or other securities entitled to vote for election of directors or other managing authority.</p>
</li>
Interestingly enough, even if I only do this in the first two list items, the unwanted line break is inserted in ALL the elements of that list.
If I remove the extra blank line between items, like this:
- **Account** means a unique account created for You to access our Service or parts of our Service
- **Affiliate** means an entity that controls, is controlled by or is under common control with a party, where "control" means ownership of 50% or more of the shares, equity interest or other securities entitled to vote for election of directors or other managing authority.
Then everything looks “correct”, but of course without the spacing that I’m looking for. Again, can’t upload a screenshot of this, but you get the idea.
And this is the new HTML:
<p>For the purposes of this Privacy Policy:</p>
<ul>
<li><strong>Account</strong> means a unique account created for You to access our Service or parts of our Service</li>
<li><strong>Affiliate</strong> means an entity that controls, is controlled by or is under common control with a party, where “control” means ownership of 50% or more of the shares, equity interest or other securities entitled to vote for election of directors or other managing authority.</li>
I’m no expert in HTML, but it looks like, when I add a blank line between list items, Hugo wraps each of them inside a <p>
element (which I guess is correct). But it also inserts a new line between the <li>
tag and the actual list item… which is then translated into a new line.
Any idea of what the issue might be here? Is it a bug with the renderer, or am I doing something wrong?
I tried switching the markdown handler to blackfriday too, but the issue persisted.
Appreciate any support with this!