Fix work item description heading anchor links

What does this MR do and why?

Ensure that heading anchor links are shown.

This is a followup to !197122 (merged), which fixed an overflow problem but broke the functionality of heading anchor links.

References

Screenshots or screen recordings

Before After
Screen_Recording_2025-08-05_at_11.09.58 Screen_Recording_2025-08-05_at_11.09.19

How to set up and validate locally

  1. Check out this branch
  2. Visit a work item
  3. Add a really long description that has at least one heading at the top, followed by some really tall images (Here's the example I used: example-description.md)
  4. Reload the page so that the description is truncated (if necessary, you may need to re-enable description truncation in the more actions menu on the work item)
  5. You should see that when the description is truncated:
    1. The anchor can be seen and clicked when the heading at the top of the description is hovered or when focus is moved to the anchor
    2. There is not a lot of extra whitespace at the bottom of the page
  6. You should see that when the description is expanded:
    1. The anchors for the headings in the description work as expected
    2. The full description is shown

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #558737 (closed), #513105 (closed)

Merge request reports

Loading