Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lists with inline code elements and nested lists have extra margin. #229

Closed
franknorton opened this issue Dec 12, 2023 · 1 comment · Fixed by #276
Closed

Lists with inline code elements and nested lists have extra margin. #229

franknorton opened this issue Dec 12, 2023 · 1 comment · Fixed by #276
Labels
bug Something isn't working
Milestone

Comments

@franknorton
Copy link

franknorton commented Dec 12, 2023

Description

When creating a list with inline code elements you get uneven spacing if the next element in the list is a list itself.

Steps To Reproduce

Create a list with the following structure in markdown to see the problem.

- `Inline code element`
    - Next element, too much spacing above this.
    - Spacing is fine here.

The resulting HTML looks like:

<ul>
  <li>
    <code>Inline code element</code>
    <ul>
      <li>Next element, too much spacing</li>
      <li>Spacing is fine here.</li>
    </ul>
  </li>
</ul>

Expected Behavior

The spacing should've zeroed out the margin-top like it does for normal nested lists.

image

This CSS does the zeroing:

.content :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)):first-child {
    margin-top: 0px;
}

Actual Behavior

image

The previous css is excluded, I believe because the ul is no longer the first-child of the containing li, the code tag is getting in the way.

Additional Context

This problem occurs with other elements besides <code>, such as when italicizing an element (<em>) or bolding it (<strong>)

Environment

  • Hugo Version: 0.121.1
  • Browser/OS: Vivaldi, Windows 11
  • Theme Version: v0.7.0
@imfing
Copy link
Owner

imfing commented Dec 19, 2023

thanks, will take a look

@imfing imfing added this to the v0.7.1 milestone Dec 21, 2023
@imfing imfing added the bug Something isn't working label Dec 21, 2023
@imfing imfing modified the milestones: v0.7.1, v0.7.2 Jan 8, 2024
@imfing imfing linked a pull request Feb 3, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants