Skip to content

Bug: TOC leaders overlap with numbers and titles #2075

@caio-pizzol

Description

@caio-pizzol

Summary

Fix tab leader rendering in Word-generated Tables of Contents so leaders don't overlap with section titles and page numbers.

Problem

When a Word document with an auto-generated TOC is opened in SuperDoc, the tab leaders (dotted, dashed, or solid lines) overlap with the header

text/page numbers on the right and section titles on the left.

Repro

  1. Open attached docx files in SuperDoc (one with dotted tabs, one with lined tabs).
  2. Observe tab leaders extending into the section title text on the left.
  3. Observe tab leaders overlapping with page numbers on the right.

Expected

Tab leaders render between the section title and page number without overlapping either, matching Word's behavior.

Notes

The issue involves w:tabs / w:tab elements with w:leader attributes (dot, hyphen, underscore, heavy). The leaders need to be bounded between the end of the text content and the tab stop position. Two sample documents are attached (dotted and lined tabs).

Attachments

image.png

Screen Shot 2026-01-20 at 1.31.22 PM.png

Screen Shot 2026-01-20 at 1.31.42 PM.png

image.png

ToC with lined tabs.docx

ToC with dotted tabs.docx


Want to work on this? Check the Contributing Guide to get started. Comment on this issue to let us know you're picking it up.

Ref: SD-1452

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions