Skip to content

Merge Development into main - #215

Open
thamudi wants to merge 2 commits into
mainfrom
development
Open

Merge Development into main#215
thamudi wants to merge 2 commits into
mainfrom
development

Conversation

@thamudi

@thamudi thamudi commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

This Merge request fixes and refactors how publication bodies are processed and how the table of contents (ToC) component is generated and rendered.

  • Centralized body processing in a new composable. Instead of parsing the HTML and extracting headings directly in the ToC component, the logic now lives in a composable that returns both the processed HTML (with ids added to the headings) and a structured list of headings. This makes sure the body is not parsed twice.

  • Fixed heading ids for Arabic and other non-Latin headings. Previously any non-Latin heading was stripped down to nothing, so all of them ended up sharing the same unusable id and their ToC links went nowhere. Ids now keep any valid letter, number, and hyphen, with a fallback to a unique id when the heading text can't produce a valid one.

  • Made the ToC collapsible. A ghost chevron button in the ToC header expands/collapses the list with a transition, and it stays expanded by default. This is a UX enhancement that is especially helpful on publications with a lot of headings (like this one), where the ToC would otherwise take up most of the sidebar (or push the body far down on mobile).

@thamudi
thamudi requested a review from thread-koder August 26, 2026 09:56
@thamudi thamudi self-assigned this Aug 26, 2026
* feat: refactor table of contents to use processed headings in different langs and avoid re-parsing body

* fix: add collapse/expand toc toggle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants