Question: how to insert heading during DocumentParsedEvent and have the table of contents pick it up? #624
Unanswered
Ambient-Impact
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there. I've gone through the documentation and issues numerous times but cannot seem to get this to work as expected. I'm trying to insert a
Heading
before aFootnoteContainer
and have that heading be picked up correctly by a table of contents. I've managed to get the heading inserted and picked up by the heading permalink:But then, the table of contents entry for it ends up with an empty item:
This is my listener attachment:
and the callbacks:
For some reason, the content I pass to the
Heading
doesn't seem to be rendered, nor usingaddLine()
- and yes, I've tried a plain string instead of Drupal'sTranslatableMarkup
- but appending a newText
seems to work for that. The actual permalink slug is generated correctly too, so I can't really see what else I need to do.Beta Was this translation helpful? Give feedback.
All reactions