When opening certain plugin dialogs, such as the Freehand Drawing plugin's drawing dialog, the application crashes. This crash occurs because the className property of the dialog can start or end with a space. When the className is split using the regular expression \s+, an empty string is included in the resulting array. The code then attempts to add this empty string as a CSS class, leading to the following error:
Expected behaviour
Expected Behavior
When opening plugin dialogs, the application should handle the className property correctly, even if it contains leading or trailing spaces. The className string should be sanitized to remove any empty strings before attempting to add CSS classes. This would prevent the crash and allow the dialogs, including the Freehand Drawing plugin's dialog, to open without issues.
Operating system
Windows
Joplin version
Joplin 2.13.9 (prod, darwin)
Desktop version info
No response
Current behaviour
Current Behavior
When opening certain plugin dialogs, such as the Freehand Drawing plugin's drawing dialog, the application crashes. This crash occurs because the
className
property of the dialog can start or end with a space. When theclassName
is split using the regular expression\s+
, an empty string is included in the resulting array. The code then attempts to add this empty string as a CSS class, leading to the following error:Expected behaviour
Expected Behavior
When opening plugin dialogs, the application should handle the
className
property correctly, even if it contains leading or trailing spaces. TheclassName
string should be sanitized to remove any empty strings before attempting to add CSS classes. This would prevent the crash and allow the dialogs, including the Freehand Drawing plugin's dialog, to open without issues.Logs
No response