Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown image does not support svg or it is broken #2160

Closed
Petrox opened this issue Nov 29, 2023 · 2 comments · Fixed by #3719
Closed

Markdown image does not support svg or it is broken #2160

Petrox opened this issue Nov 29, 2023 · 2 comments · Fixed by #3719
Assignees
Labels
controls enhancement Improvement/Optimization

Comments

@Petrox
Copy link

Petrox commented Nov 29, 2023

Description

Markdown supports images.
Flet supports images.
Flet images support svg.

Markdown does not seem to work with svgs.

Code example to reproduce the issue:

md1 = """
hello

![Screenshot of a comment on a GitHub issue showing an image, added in the Markdown, of an Octocat smiling and raising a tentacle.](https://myoctocat.com/assets/images/base-octocat.svg)

world
"""

def main(page: ft.Page):
    page.scroll = "auto"
    page.add(
        ft.Markdown(
            md1,
            selectable=True,
            extension_set=ft.MarkdownExtensionSet.GITHUB_WEB,
            on_tap_link=lambda e: page.launch_url(e.data),
        )
    )

ft.app(target=main, view=ft.AppView.WEB_BROWSER)

Describe the results you received:

kép

Describe the results you expected:

hello
Screenshot of a comment on a GitHub issue showing an image, added in the Markdown, of an Octocat smiling and raising a tentacle.
world

This code was directly copied from the github markdown docs: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax

Additional information you deem important (e.g. issue happens only occasionally):

Flet version (pip show flet):
0.11
0.13

Operating system:

Win10

Additional environment details:
Does not work in either windows native app or web app either.

Note: the svg could contain links so clicking those should cause on_tap_link events in theory.

@ndonkoHenri ndonkoHenri self-assigned this Jul 27, 2024
@ndonkoHenri ndonkoHenri added enhancement Improvement/Optimization controls labels Jul 27, 2024
@ndonkoHenri ndonkoHenri moved this from 🆕 New to 👀 In review in Flet Development Jul 27, 2024
@ndonkoHenri ndonkoHenri linked a pull request Jul 28, 2024 that will close this issue
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Flet Development Aug 5, 2024
@Petrox
Copy link
Author

Petrox commented Aug 5, 2024

👍

@FeodorFitsner
Copy link
Contributor

You can test this feature with pre-release build of Flet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
controls enhancement Improvement/Optimization
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants