Skip to content

fix: auto heading numbering respects manually numbered headings - #7

Merged
atom-tech9 merged 1 commit into
mainfrom
dev
Jul 6, 2026
Merged

atom-tech9 merged 1 commit into
mainfrom
dev

Conversation

@atom-tech9

Copy link
Copy Markdown
Owner

Documents whose headings already carry numbers ('## 1. Executive Summary', '### 3.1 Storage') rendered doubled/offset numbers with numberedHeadings on (e.g. '1.2 1. Executive Summary'). Self-numbered headings are now detected (startsWithManualNumber — Latin + Arabic-Indic digits, '1.'/'2)'/'3.1'/glued '1.Intro'; year-like '2024 Report' and '3D' stay untouched) and become fully transparent to the auto counters — no prefix, no increment, no child reset — in both the CSS-counter preview and the baked-number PDF export, so the two always agree. Covered by unit tests and verified end to end against the reporting document that hit the bug.

Summary

Type of Change

  • feat — new feature
  • fix — bug fix
  • docs — documentation only
  • refactor — code change that neither fixes a bug nor adds a feature
  • chore — tooling / maintenance
  • test — adding or updating tests
  • perf — performance improvement
  • ci — CI / build changes

Screenshots

Checklist

  • npm run typecheck passes
  • npm run lint passes
  • npm run build passes
  • Follows the project code style (no any, immutable updates, logical CSS)
  • i18n keys added for any new user-facing strings (en and ar)
  • RTL layout verified for UI changes
  • No console.log (uses @/lib/logger)
  • Documentation updated if needed

Documents whose headings already carry numbers ('## 1. Executive
Summary', '### 3.1 Storage') rendered doubled/offset numbers with
numberedHeadings on (e.g. '1.2 1. Executive Summary'). Self-numbered
headings are now detected (startsWithManualNumber — Latin +
Arabic-Indic digits, '1.'/'2)'/'3.1'/glued '1.Intro'; year-like
'2024 Report' and '3D' stay untouched) and become fully transparent
to the auto counters — no prefix, no increment, no child reset — in
both the CSS-counter preview and the baked-number PDF export, so the
two always agree. Covered by unit tests and verified end to end
against the reporting document that hit the bug.
@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
scripto Building Building Preview, Comment Jul 6, 2026 11:43am

Request Review

@atom-tech9
atom-tech9 merged commit d61bb13 into main Jul 6, 2026
2 of 3 checks passed

This branch was successfully deployed

1 active deployment
Preview — 54b3bbe5 Deployed Jul 6, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants