Problem/Motivation

Discovered on https://www.drupal.org/about/core/policies/maintainers/commit-guide#comm....

The auto-generated permalinks for <h4> headers (and possibly <h3> etc. as well) overlap the list item bullets when used inside a list.

Steps to reproduce

  1. Add the following markup to a guide page:
    <ol>
    <li>
    <h4>Example header</h4>
    
    </li>
    </ol>
    
  2. Observe that the # permalink overlaps the list bullet.

Proposed resolution

Needs some negative margin or padding fix.

Remaining tasks

User interface changes

Ideally the fragments are properly nested within the list items.

API changes

Small CSS change.

Data model changes

N/A

CommentFileSizeAuthor
ol_h4_issue.png44.25 KBxjm
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

xjm created an issue. See original summary.

xjm’s picture

Issue summary: View changes
drumm’s picture

Assigned: Unassigned » drumm

The negative margins only kick in at large screen sizes, when there is a left margin to hang the octothorp in. At smaller screen sizes, they are shown inline. We can do the same, at all screen sizes, for any headings that are not top-level within their field. This should be more straightforward & resilient, negative margins are prone to edge cases like this.

  • drumm committed 83743f6 on 7.x-2.x
    Issue #3231601: Avoid margin/padding bug when headers are nested
    
drumm’s picture

Status: Active » Fixed

This has been deployed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.