You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since the name configuration can "also contain custom HTML for easier customization" (due to its primary/first use in the sidebar) using the name for page title generation can produce some ugly results.
(In relation to #2478)
Proposal
A. Allow for the definition of a title generator (pageTitleFormatter) as recommended by @Koooooo-7 in #2478
B. Keep the new use of name for title generation, but create a new configuration (sidebar) that could be used to modify the sidebar directly.
hook.doneEach does not seem to work, I see the intended page title flash briefly before it reverts back to the html goop, does that mean I need to use hook.ready instead?
This seems like a hacky work around, is there consideration for new configuration (like sidebar) that could be used to support HTML? It just seems odd that your configuration page boasts "the name field can also contain custom HTML for easier customization", but it will now come with the downside of a weird page title (unless using this weird trick).
@QingWei-Li : #2690 does a pretty good job of improving the situation but does not solve this problem completely.
Using a name configuration like the one shown in the screenshot: <div style="text-align:center;"><img src="ExampleLogo.svg" style="display: block; margin: -30px auto; height:120px;"><br>example.wiki<br><small style="font-style: italic;">Woah! A subtitle.</small></div>
Would result in a title of: Page - example.wikiWoah! A subtitle.
Which is still a malformed result if the user would like it to be simply Page - example.wiki.
Activity
sy-records commentedon Oct 17, 2025
Thank you for your feedback. I believe this is currently a bug, and I have submitted a pull request to fix it.
You can use
hook.doneEachto modify the title, so we are not currently providing apageTitleFormatter.BrysonC commentedon Nov 3, 2025
hook.doneEachdoes not seem to work, I see the intended page title flash briefly before it reverts back to the html goop, does that mean I need to usehook.readyinstead?This seems like a hacky work around, is there consideration for new configuration (like
sidebar) that could be used to support HTML? It just seems odd that your configuration page boasts "the name field can also contain custom HTML for easier customization", but it will now come with the downside of a weird page title (unless using this weird trick).fix: strip HTML tags from config.name when setting page title
fix: strip HTML tags from config.name when setting page title (#2690)
BrysonC commentedon Mar 4, 2026
@QingWei-Li : #2690 does a pretty good job of improving the situation but does not solve this problem completely.
Using a
nameconfiguration like the one shown in the screenshot:<div style="text-align:center;"><img src="ExampleLogo.svg" style="display: block; margin: -30px auto; height:120px;"><br>example.wiki<br><small style="font-style: italic;">Woah! A subtitle.</small></div>Would result in a title of:
Page - example.wikiWoah! A subtitle.Which is still a malformed result if the user would like it to be simply
Page - example.wiki.BrysonC commentedon Mar 16, 2026
@sy-records / @Bowl42 Please reopen this issue as it is still not fully resolved in #2694 . Please see my note above.
sy-records commentedon Mar 16, 2026
Adding pages - example.wikiWoah! A subtitle.I think this is the right approach; we simply can't accommodate all user inputs.
But I added a
pageTitleFormatterconfig #2695