Closed InesaFitsner closed 2 months ago
Seems like I am getting a different output.
md = """
import flet
from flet import IconButton, Page, Row, TextField, icons
def main(page: Page):
page.title = "Flet counter example"
page.vertical_alignment = "center"
txt_number = TextField(value="0", text_align="right", width=100)
def minus_click(e):
txt_number.value = int(txt_number.value) - 1
page.update()
def plus_click(e):
txt_number.value = int(txt_number.value) + 1
page.update()
page.add(
Row(
[
IconButton(icons.REMOVE, on_click=minus_click),
txt_number,
IconButton(icons.ADD, on_click=plus_click),
],
alignment="center",
)
)
flet.app(target=main, port=8550)
"""
def main(page):
page.scroll = True
page.window.always_on_top = True
page.add(
ft.Markdown(
value=md,
selectable=True,
extension_set=ft.MarkdownExtensionSet.GITHUB_WEB,
code_theme=ft.MarkdownCodeTheme.ATOM_ONE_DARK,
code_style_sheet=ft.MarkdownStyleSheet(
code_text_style=ft.TextStyle(font_family="Roboto Mono"),
),
)
)
ft.app(main)
Was issue with my environment
Duplicate Check
Describe the bug
In the Controls Gallery app (https://flet-controls-gallery.fly.dev/displays/markdown), Flet version 0.21.2, code is displayed normally.
In 0.24.1, colors in the code displayed differently and some of them are not visible on the dark background.
Code sample
Code
import flet as ft def main(page: ft.Page): table = """ ### Create Python program Create a new Python program using Flet which will be driving the content of `FletApp` widget. Let's do a simple `counter.py` app similar to a Flutter new project template: ```python import flet from flet import IconButton, Page, Row, TextField, icons def main(page: Page): page.title = "Flet counter example" page.vertical_alignment = "center" txt_number = TextField(value="0", text_align="right", width=100) def minus_click(e): txt_number.value = int(txt_number.value) - 1 page.update() def plus_click(e): txt_number.value = int(txt_number.value) + 1 page.update() page.add( Row( [ IconButton(icons.REMOVE, on_click=minus_click), txt_number, IconButton(icons.ADD, on_click=plus_click), ], alignment="center", ) ) flet.app(target=main, port=8550) ``` """ page.add( ft.Markdown( table, selectable=True, extension_set=ft.MarkdownExtensionSet.GITHUB_WEB, code_theme=ft.MarkdownCodeTheme.ATOM_ONE_DARK, code_style_sheet=ft.MarkdownStyleSheet( code_text_style=ft.TextStyle(font_family="Roboto Mono") ), # on_tap_link=lambda e: ft.page.launch_url(e.data), ) ) ft.app(target=main)To reproduce
Run https://flet-controls-gallery.fly.dev/displays/markdown and see how code looks in 0.21.2:
Run example code with 0.24.1 and result is this:
Expected behavior
Expected to look in 0.24.1 same as in 0.21.2.
Screenshots / Videos
Captures
[Upload media here]Operating System
macOS
Operating system details
macOS
Flet version
0.24.1
Regression
Yes, it used to work in a previous Flet version (please specify the version in additional details)
Suggestions
No response
Logs
Logs
```console [Paste your logs here] ```Additional details
No response