fonsp / Pluto.jl

🎈 Simple reactive notebooks for Julia
https://plutojl.org/
MIT License
4.91k stars 284 forks source link

[Markdown] Interpolation of variables in URLs does not work #2948

Open tamasgal opened 3 days ago

tamasgal commented 3 days ago

For some reason, the URL syntax is not working when interpolating variables in the URL markdown syntax [Link name](URL). Variables enclosed by the square brackets gets interpolated, but those in the URL part not.

In the screenshot below, the first URL is pointing to localhost:1234/$(pluto_url), so no variable interpolation is being done.

Screenshot 2024-07-04 at 10 19 34

I checked in the REPL and the escaping of the parentheses is definitely needed and produces the correct markdown output, I think, so I am not sure why Pluto displays the raw text:

julia> md"""
       [Pluto]($(pluto_url)) (points to **localhost:1234/\$(pluto_url)** -> no interpolation)

       [Pluto]\($(pluto_url)\) (interpolates correctly but prints as it is, without assembling the href)

       [$(pluto_url)](Pluto) (interpolates correctly within the square brackets, but )

       Here is the URL: $(pluto_url)
       """
  Pluto ($(pluto_url)) (points to localhost:1234/$(pluto_url) -> no interpolation)

  [Pluto](https://www.plutojl.org) (interpolates correctly but prints as it is, without assembling the href)

  https://www.plutojl.org (Pluto) (interpolates correctly within the square brackets, but )

  Here is the URL: https://www.plutojl.org

Any ideas?