Skip to content

[BUG] Forward slash is changed to %2F in link #11182

Description

@jenssss

When inserting a link using TapTool and OpenURL, formatting with a @link type string, any forward slash character is converted to %2F, making the link broken. I found this behaviour in Bokeh 2.3.0 and 2.3.1, but not in 2.2.3, where the forward slashes are correctly included in the link.

I'm using python 3.9.4 (from conda) on Ubuntu 20.04.2 LTS, with notebook 6.3.0, tested in both firefox 87.0 and chromium 90.0.4430.72.

Below is an MWE, adopted from the docs

from bokeh.models import ColumnDataSource, OpenURL, TapTool
from bokeh.plotting import figure, output_file, show

output_file("openurl.html")

p = figure(plot_width=400, plot_height=400,
           tools="tap", title="Click the Dots")

source = ColumnDataSource(data=dict(
    x=[1, 2],
    y=[2, 5],
    link=["en/latest/",
          "en/latest/docs/reference/models/callbacks.html?highlight=openurl#bokeh.models.callbacks.OpenURL", 
          ]
    ))

p.circle('x', 'y', size=20, source=source)

url = "https://docs.bokeh.org/@link"
taptool = p.select(type=TapTool)
taptool.callback = OpenURL(url=url)

show(p)

When run in bokeh 2.3.0 or 2.3.1, upon clicking the dot at (x=1, y=2) ,the browser opens https://docs.bokeh.org/en%2Flatest%2F, rather than https://docs.bokeh.org/en/latest/ which is opened when using bokeh 2.2.3.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions