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 broken when an image is not found when using flet -d #2158

Closed
Petrox opened this issue Nov 29, 2023 · 1 comment · Fixed by #3719
Closed

Markdown broken when an image is not found when using flet -d #2158

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

Comments

@Petrox
Copy link

Petrox commented Nov 29, 2023

I searched for duplicate issue, didn't found.

Mentioned the problem on discord, no response.

Description

Markdown often breaks silently on images and produces a huge grey zone without content when run by flet -d

Code example to reproduce the issue:

Go to: https://flet.dev/docs/controls/markdown/
Copy the whole example to mdtest.py

Run with flet -d mdtest.py

import flet as ft

md1 = """
![Image from Flet assets](/icons/icon-192.png)
"""

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)

Describe the results you received:
Empty dialog with a vertically scrollable grey zone:

kép

Note: the example does not contain the icon assets.

Describe the results you expected:

The example from the docs:
custom-markdown

Additional information you deem important (e.g. issue happens only occasionally):
It works mostly when I run the program directly and I use the web browser.

Flet version (pip show flet):

$ pip show flet
Name: flet
Version: 0.13.0

Operating system:

Windows 10

Additional environment details:
Python 3.12

@brycepg
Copy link

brycepg commented Jun 27, 2024

I encountered this as well for flet app mode. Works fine in flet web mode. -- flet fails to render all markdown in the Markdown object if there is a broken local image link.

@ndonkoHenri ndonkoHenri self-assigned this Jul 27, 2024
@ndonkoHenri ndonkoHenri added enhancement Improvement/Optimization controls labels Jul 27, 2024
@ndonkoHenri ndonkoHenri moved this to 👀 In review in Flet Development Jul 27, 2024
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Flet Development Aug 5, 2024
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