deephaven / web-client-ui

Deephaven Web Client UI
Apache License 2.0
29 stars 31 forks source link

Commas aren't properly encoded in links in markdown files run from the IDE #1385

Open jjbrosnan opened 1 year ago

jjbrosnan commented 1 year ago

Description

Create a markdown file and put it in /data/storeage/notebooks. The file should link to some other file that has a comma in the name, e.g:

File 1: file1.md, contains a link to file 2 (with VSCode's automated suggestion for file 2). File 2: file2, hello.md

Run Deephaven and attempt to open the link to File 2. An error will appear saying the file doesn't exist.

Space characters are %20 in ASCII hex, and commas are %2C in ASCII hex. The file name, if you hover the mouse over the link, shows the spaces properly but not commas, which still show as %2C.

I'm not sure if this is limited to only markdown files, but it was first seen in our demo system and reproduced locally.

Expected results

The other markdown file to open.

Actual results

An error saying the linked file doesn't exist.

Additional details and attachments

Versions

dsmmcken commented 1 year ago

This feature is really only intended for the demo system. We can url encode all links, but it looks like to date you've been manually url encoding links?

https://github.com/deephaven/deephaven-kube-demo/blob/d5e6ff8b90954abd21c99a27498bd5d4f422b4d1/worker/ide/data/storage/notebooks/00.%20The%20Deephaven%20IDE.md?plain=1#L67

If so we would have to update those to not be url encoded. We could try to prevent double encoding but not sure if there are exceptions that might make that complicated encodeURIComponent(decodeURIComponent(url))

mofojed commented 1 year ago

This only comes into play in the Markdown Notebook which is only exposed via the demo systems. Recommending we manually encode URIs for demo for now. Moving to backlog until/if we ever decide to expose Markdown Notebooks to the general audience.