[Bug Report]: Headers nested within other elements are not assigned IDs for Page Navigation #2489

Closed
opened 2026-02-05 04:18:44 +03:00 by OVERLORD · 7 comments
Owner

Originally created by @bourdaisj on GitHub (Nov 17, 2021).

Describe the Bug

In the top left of a page where you got the "Page navigation" section, there are links with anchors to get the user to the title on click. But in my case the title have no id so the anchors link are not working (Example : https://bookstackuri.com/books/bookname/page/pagename#

Steps to Reproduce

  1. Create a page
  2. Create a table
  3. Create some headers (tiny headers => h5) in the table
  4. Once created, visit the page
  5. Head to the "page navigation" section (top left) and click on on or more headers

Expected Behaviour

The element (in my case h5) should have an id when being created so that the system can generate a correct anchor link

Screenshots or Additional Context

I'm observing this bug in 21.10.03, but I believe the page was created under version 0.30 (approximately)

Exact BookStack Version

21.10.03 or +/-0.30

PHP Version

7.4

Hosting Environment

Ubuntu 20.04

EDIT : I can work on it if needed
EDIT 2 : steps to reproduce update

Originally created by @bourdaisj on GitHub (Nov 17, 2021). ### Describe the Bug In the top left of a page where you got the "Page navigation" section, there are links with anchors to get the user to the title on click. But in my case the title have no id so the anchors link are not working (Example : https://bookstackuri.com/books/bookname/page/pagename# ### Steps to Reproduce 1. Create a page 2. Create a table 3. Create some headers (tiny headers => h5) in the table 2. Once created, visit the page 3. Head to the "page navigation" section (top left) and click on on or more headers ### Expected Behaviour The element (in my case h5) should have an id when being created so that the system can generate a correct anchor link ### Screenshots or Additional Context I'm observing this bug in 21.10.03, but I believe the page was created under version 0.30 (approximately) ### Exact BookStack Version 21.10.03 or +/-0.30 ### PHP Version 7.4 ### Hosting Environment Ubuntu 20.04 EDIT : I can work on it if needed EDIT 2 : steps to reproduce update
OVERLORD added the 🐛 Bug🏭 Back-End labels 2026-02-05 04:18:44 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Nov 18, 2021):

Thanks for reporting @Julesdevops but I can't seem to reproduce this. Top level content blocks, such as these headers, should automatically be assigned unique IDs. This has long been functionality in BookStack.

  • What editor are you using (Standard WYSIWYG or Markdown)?
  • Are you able to re-produce this on our demo instance?
@ssddanbrown commented on GitHub (Nov 18, 2021): Thanks for reporting @Julesdevops but I can't seem to reproduce this. Top level content blocks, such as these headers, should automatically be assigned unique IDs. This has long been functionality in BookStack. - What editor are you using (Standard WYSIWYG or Markdown)? - Are you able to re-produce this on [our demo instance](https://demo.bookstackapp.com/books/bookstack-demo-site/page/logging-in-to-the-demo-site)?
Author
Owner

@bourdaisj commented on GitHub (Nov 18, 2021):

Thanks for the rapid feedback @ssddanbrown
Our instance is using the standard WYSIWYG.
Actually I am able to reproduce this bug on the demo instance. (maybe it'll be down when you see this but anyway : https://demo.bookstackapp.com/books/bookstack-demo-site/page/testtest-test-test-test#)
It seems to happen when title are in a table...

Screenshot:
image
image

@bourdaisj commented on GitHub (Nov 18, 2021): Thanks for the rapid feedback @ssddanbrown Our instance is using the standard WYSIWYG. Actually I am able to reproduce this bug on the demo instance. (maybe it'll be down when you see this but anyway : https://demo.bookstackapp.com/books/bookstack-demo-site/page/testtest-test-test-test#) It seems to happen when title are in a table... Screenshot: ![image](https://user-images.githubusercontent.com/58701261/142455700-3643da30-7b72-4448-8b32-1aed9c2f3ceb.png) ![image](https://user-images.githubusercontent.com/58701261/142456032-dc5889ad-b685-4b7d-98a7-447613a1a5bc.png)
Author
Owner

@ssddanbrown commented on GitHub (Nov 18, 2021):

@Julesdevops Thanks for the confirmation. Yeah, Can see why that would break things. We currently parse and apply ids to the top-level elements only.

Will update this issue to be specific to nested header usage.

@ssddanbrown commented on GitHub (Nov 18, 2021): @Julesdevops Thanks for the confirmation. Yeah, Can see why that would break things. We currently parse and apply ids to the top-level elements only. Will update this issue to be specific to nested header usage.
Author
Owner

@bourdaisj commented on GitHub (Nov 18, 2021):

I can surely provide a PR to fix this.
Do you want to simply disable navigation links for non top-level headers or fix the bug and assign IDs to the nested headers ?

@bourdaisj commented on GitHub (Nov 18, 2021): I can surely provide a PR to fix this. Do you want to simply disable navigation links for non top-level headers or fix the bug and assign IDs to the nested headers ?
Author
Owner

@ssddanbrown commented on GitHub (Nov 18, 2021):

Thanks for offering a PR @Julesdevops. To be honest, I have no major preference but I'd probably sway towards the idea of not showing such headers in the navigation. Easier to implement (Just filter out headers without an ID) and there's probably less chance they're actually used for hierarchy in such scenarios, but if you'd find value in having them show as part of the navigation I don't mind going down that route either.

@ssddanbrown commented on GitHub (Nov 18, 2021): Thanks for offering a PR @Julesdevops. To be honest, I have no major preference but I'd probably sway towards the idea of not showing such headers in the navigation. Easier to implement (Just filter out headers without an ID) and there's probably less chance they're actually used for hierarchy in such scenarios, but if you'd find value in having them show as part of the navigation I don't mind going down that route either.
Author
Owner

@bourdaisj commented on GitHub (Nov 19, 2021):

Tbh I don't mind either but since my customer has an interest in solution 2 I'm going that way.

@bourdaisj commented on GitHub (Nov 19, 2021): Tbh I don't mind either but since my customer has an interest in solution 2 I'm going that way.
Author
Owner

@ssddanbrown commented on GitHub (Nov 23, 2021):

Fixed in #3069, To be part of next release, Will therefore close this off.

@ssddanbrown commented on GitHub (Nov 23, 2021): Fixed in #3069, To be part of next release, Will therefore close this off.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2489