Skip to content

Conversation

@Flamenco
Copy link
Contributor

Fixes a panic when processing headers that contain only attributes (e.g., # {#custom-id}) or other non-text content.

Problem:
Headers with no Text or Code events would leave the span end at 0 while the start was a positive offset, causing a slice panic: begin <= end (16 <= 0) when slicing.

This can happen when an include file contains and the document has headers with only custom ID attributes.

Solution:

  • Track header span end as Option instead of usize
  • Skip headers where no text content was found

Includes a regression test.


@badboy badboy enabled auto-merge (rebase) December 27, 2025 14:32
@badboy badboy disabled auto-merge December 27, 2025 16:12
@badboy badboy merged commit 9d62234 into badboy:main Dec 27, 2025
1 of 2 checks passed
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