-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
In certain cases, the a MarkdownComponent can have 0 drawables, which causes a NotImplementedError here.
To Reproduce
Steps to reproduce the behavior:
- Apply this patch to
ComponentsGui
@@ -267,7 +268,7 @@
} childOf window
ComponentType("Markdown") {
- MarkdownComponent(
+ val c = MarkdownComponent(
"""
# Markdown!
@@ -283,6 +284,11 @@
width = 200.pixels()
height = 100.pixels()
} childOf this
+
+ c.onMouseClick {
+ c.bindText(BasicState(""))
+ }
+
} childOf window
ComponentType("SVG") {- Open the components gui
- Click on the current text of the markdown component, hold and drag to another location on the screen
- The gui crashes and a NotImplementedError is logged (example)
Expected behavior
The the markdown component becomes blank without crashing the gui.
Additional context
There are possibly other ways to trigger this issue, but this is the way I found. The root cause appears to be commonmark's parser not having any children nodes for a blank document, causing MarkdownRenderer to produce an empty drawable list
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
