☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Safe html in widget title

Community Support
Amjad_Al_Taleb
Amjad_Al_Taleb

Is there away to prevent String.escape() in Widget title?
For example, I used:

Slider(title="Δ x", value=0,...)

with the hope of getting:

<div class="bk bk-slider-title">
    &Delta; x: <span class="bk bk-slider-value">0</span>
</div>

instead I get:

<div class="bk bk-slider-title">
    &amp;Delta; x: <span class="bk bk-slider-value">0</span>
</div>

I am thinking of adding a custom class to the widget then use JavaScript that replaces the html text of the element after document loading, is there another way?

⌁   Link to post
Amjad_Al_Taleb
Amjad_Al_Taleb

I added the following to the custom script in the page, not ideal, but works for me:

$('.bk-slider-title').each( function(e){ 
    $(this).text($(this).text().replace("Delta ", unescape("%u0394")));
})

after change the title to title="Delta x".

⌁   Link to post
Bryan
Bryan

BTW note that there is ongoing work to add “mathtext” to Bokeh but initial work is focusing on plot elements, I am not sure when things like widget titles will be prioritized.

⌁   Link to post

End of archived discussion · Replies are disabled