Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unique ID Generation for Headings with Duplicate Titles #14

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

PxaMMaxP
Copy link

This commit addresses the issue where headings without an explicit ID resulted in ambiguous IDs for repeated headings (e.g., multiple "Summary" headings).

Changes made:

  • PHP:
    • When a heading lacks an ID, a unique identifier is now generated by appending the heading's index to its content-derived ID. This ensures each heading ID is distinct, even when the heading text is repeated across the document.

…of the heading. In the case of repeated headings (e.g. “Summary”), this leads to an ambiguous ID.

The problem is solved by adding the index of all headings to the ID generated in this case.

Changes to
- PHP:
   If the ID does not exist, the given index is appended to the generated ID.
@PxaMMaxP
Copy link
Author

Issue: #12

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.

None yet

1 participant