jupyterlab-myst icon indicating copy to clipboard operation
jupyterlab-myst copied to clipboard

Duplication of link URL parsing

Open rowanc1 opened this issue 2 years ago • 2 comments

We are currently using a duplicated function out of @jupyterlab/rendermime introduced in executablebooks/jupyterlab-mystjs#13.

The following Private function was copied without modification: https://github.com/jupyterlab/jupyterlab/blob/2e8677624ed7301d47de703570a14ce3bb8036cf/packages/rendermime/src/renderers.ts#L950

There doesn't seem to be a way to get at that code without copying it out (certainly not intentionally, as it is marked private). It would be nice to stay as close as possible to the default JupyterLab markdown renderer, and these sorts of soft-forks don't feel great. :(

I am not sure if this constitutes an upstream modification though, as we are starting to get at internals of the markdown renderer that are maybe not designed to be gotten at?!

Any advice appreciated!

rowanc1 avatar Feb 01 '23 20:02 rowanc1

TBH I'm not too worried, because it's not a huge amount of logic. I equally see your point. Perhaps @bollwyvl has a sense for whether this is worth asking for upstream.

agoose77 avatar Feb 01 '23 20:02 agoose77

Hah, been there on jupyterlab-deck. There I wish it emitted a signal, as well, as sometimes you want to do something with an anchor click as well.

I think if the renderer is pluggable, that detail should be available in a utils.ts or something. It doesn't seem like a breaking change, so hoisting it could land in 3.x, even. Feature freeze for 4.x is the end of this month.

bollwyvl avatar Feb 01 '23 22:02 bollwyvl