-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Fix regular expression related checkbox logic #3001
Conversation
I'm gonna be criticizing as hard as I can 🤣 Anyway, welcome to OSS |
Thank you for checking precisely 😄 |
Well, I'll need confirmation from the "higher" power @Rokt33r |
LGTM. Just one thing I've noticed is that sub-elements are striked through if the top element is checked. I think you haven't introduced the issue but it's a bit weird and it would be probably better to not have them striked as they're not handled in the action item done count. See screenshot below, everything seems done but the counter says 60%. I'll have a look at your regex updates in a minute and leave an inline comment if there is something to improve. |
const checkReplace = /\[x\]/i | ||
const uncheckReplace = /\[ \]/ | ||
const checkedMatch = /^(\s*>?)*\s*[+\-*] \[x]/i | ||
const uncheckedMatch = /^(\s*>?)*\s*[+\-*] \[ ]/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've first thought there are missing escape sequences in the regex but I think it's OK to omit them.
I did a quick test in the following regex101 - just wondering why the nested checkboxes are not matching there.
Is it because in Boostnote it is running in a loop or do I have a mistake in the regex101 test patterns?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a line pattern and only matched the first occurrence
@AWolf81 The nested checkbox is strikethrough is because of the CSS property
If that CSS property is applied to the parent element, the children element will be affected too which is a bit weird. You're right, it should be solved in a separated issue, it may be difficult to solve. |
i think this strike through behaviour is intended, but I also think it is weird 😣 |
LGTM. And I'm also thinking it is a bit weird. Let's fix it in other pr. |
Description
As described in issue, checkbox was unclickable in quotation.
Fixed regular expression on checkbox logic and added some test patterns.
This is my first contribution to OSS in my life. 😄
Please kindly point out if there is something wrong 🙏
Issue fixed
#2829
Type of changes
Checklist: