Skip to content

Bookmark Permalinks Within Table Are Misnamed When Adding a Row Mid-Table #5582

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

Open
2 tasks done
zennnzonnne opened this issue Apr 16, 2025 · 1 comment
Open
2 tasks done

Comments

@zennnzonnne
Copy link

zennnzonnne commented Apr 16, 2025

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

I've got a two column table that I'm using to organize a glossary of terms. Column 1 are the terms and Column 2 are the definitions. To easily link to words within that glossary (and for styling), each glossary term is a "Tiny Header". Each corresponding column 2 is using "Paragraph" styling. When I add more rows, I get duplicate, versioned permalinks rather than unique permalinks. Also – the new row takes the old permalink, and the old row versions the permalink.

Example :

  • If my glossary term is "Some Term", my permalink for "Some Term" is /3#bkmrk-some-term.
  • If I add a blank row above "Some Term", and the term is "Another Term", my permalink for the "Another Term" is /3#bkmrk-some-term and "Some Term" becomes /3#bkmrk-some-term-1

I've tried to remove the formatting of the table, I've tried changing all text to paragraph styling, saved it, and back to header styling, and the wrong bkmrk link persists throughout.

Oddly, if I do this same thing outside of a table, it functions the way you'd expect it to: "Some Term" remains "some-term" and "Another Term" becomes "another-term".

Ideally, I'd like the "Some Term" permalink to remain /3#bkmrk-some-term and for "Another Term" to have the permalink that is /3#bkmrk-another-term.

Perhaps a method to audit and repair permalinks within a table?

I'm not using the new WYSIWYG beta editor.

Exact BookStack Version

BookStack v24.12.1

Log Content

No response

Hosting Environment

can't remember but can look it up if it's critical here.

@ssddanbrown
Copy link
Member

Hi @zennnzonnne,

So there are a couple of things at play here.
BookStack tries to keep IDs (the latter part of the permalink) stable, so will try to retain an existing id as-is unless they are a duplicate or an ID does not exist.
In this case, the when adding the new row above, the editor copies over the active formatting (header) along with its ID.
When saved, BookStack will see the original row header (since it's later in the document) has a duplicate ID, and therefore change it.

The new editor works differently so this does not seem to be an issue, at least for these specific steps (although the new editor may have other quirks when it comes to ids and table handling right now).

You could tweak the IDs yourself though, in either editor.
The third button from the right in the editor toolbar allows you to see and edit the page source. You can find and alter the ids manually in there. The ID does need to start with bkmrk- though otherwise BookStack will replace it on save.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants