Hovertool Displaying value contains symbol &

hi, on the hover tool, cannot get the value display properly when it contains symbol &.

here the setup tip. have tried set up with and without {}, both gave same result.
hover_tip=[(“voucher id”,"@voucher_id"),
(“voucher name”,"@{voucher_name}"),
]

screenshot of the column value, showing value contains symbol &.
bokeh_value contains special &

screenshot of the chart when hover, showing the error
chart_hover_special symbol error

i am running the code on JupyterLab and Firefox. not sure it is to do with browser and bokeh, or there is way to overcome it.

[Reposting after data loss during a site recovery

@mhlearn you need to add the {safe} tag to prevent escaping

("voucher name","@{voucher_name}{safe}"),

tested and it is working. thanks a lot. this is first time i come across {safe}, checked back bokeh doc and found it under custom tooltip Configuring plot tools — Bokeh 2.4.2 Documentation. thanks @Bryan

1 Like