textual
textual copied to clipboard
url returned by href parameter in LinkClicked is decoding when it should not (Markdown Widget)
Noted that authenticated links were breaking with signature failures, and tracing it down found that the link being returned is not the same as the link being clicked. example:
#!/usr/bin/python3
from textual.app import App, ComposeResult
from textual.widgets import Markdown
text = """
Here is an image of a dog created with DALL-E 3:

"""
log_file = "linktest.txt"
class MyApp(App):
def compose(self) -> ComposeResult:
self.md = Markdown(markdown=text)
yield self.md
def on_markdown_link_clicked(self, message: Markdown.LinkClicked):
with open(log_file, "w") as f:
f.write(f"Original message={text}\n")
f.write(f"Link received={message.href}\n")
if __name__ == "__main__":
app = MyApp()
app.run()
Output:
Original message=
Here is an image of a dog created with DALL-E 3:

Link received=https://some.site.us/tool?st=2024-12-22T18:07:22Z&se=2024-12-22T20:07:22Z
Note the decoding. I would expect that the link received would be identical to the link in the Markdown.