Skip to content

Encoding issue (?) in the message sent by Markdown.LinkClicked #3350

Closed
@VincentDemery

Description

@VincentDemery

I have what seems to be an encoding issue with the message sent by Markdown.LinkClicked.

Consider the code below, with accented characters. "tété" shows up correctly in the Markdown widget. Clicking on it, and thus sending the message.href "tété" replaces the text by "t%C3%A9t%C3%A9", where it should be "tété". I do not know how the message handles the string, or what is the encoding used.

#!/usr/bin/python3

from textual import on
from textual.app import App, ComposeResult
from textual.widgets import Markdown

class MyApp(App):
    def compose(self) -> ComposeResult:
        self.md = Markdown(markdown="[tété](tété)")
        yield self.md
            
    def on_markdown_link_clicked(self, message: Markdown.LinkClicked):
        self.md.update(message.href)

if __name__ == "__main__":
    app = MyApp()
    app.run()

It will be helpful if you run the following command and paste the results:

textual diagnose

I am sorry but this command returns textual not found. I use Archlinux with

  • python 3.11.5-2
  • python-textual 0.36.0-1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions