super_editor
super_editor copied to clipboard
[SuperEditor][Bug] - Styler (falsely) assumes that all block types are `NamedAttribution`s
The Super Editor styler assumes that all block types are NamedAttribution
s, but this shouldn't be a requirement. Any Attribution
should work.
The issue can be found in styles.dart
within the matches()
method. Adjust that method, and any other relevant methods, to work with other types of attributions. At a minimum, it shouldn't crash.
The situation that lead to this error is an attribution in a client app where the attribution has a color for the whole node. I tried to implement this with implements Attribution
, but then the app crashed.
Once the crash is resolved, it's also worth thinking how a block selector might work for attributions other than named attributions. Perhaps the styler should operate on the attribution id
property instead of the name
. I don't know if there are negative consequences of that or not, but we should take a look at it.