Skip to content
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

identifier with regex character is not properly matched #242

Closed
rgalonso opened this issue Nov 12, 2024 · 0 comments · Fixed by #243
Closed

identifier with regex character is not properly matched #242

rgalonso opened this issue Nov 12, 2024 · 0 comments · Fixed by #243

Comments

@rgalonso
Copy link
Contributor

If the identifier contains regex characters, the issue is not properly created. For example, using identifier [TODO] with a comment like [TODO]: implement the widget causes problems. In version v5.1.1 (and earlier), this leads to an issue not being created. In v5.1.2, this leads to an issue with title ]: implement the widget being created.

In v5.1.1, this is due to the parser not escaping the identifier when performing the regex search for the identifier and title. In V5.1.2, it's due to the word boundary marker \b not properly handling [ and ] characters. The general solution going forward needs to be that

  1. the identifier is escaped, and
  2. a slightly different pattern which doesn't rely on \b is used to find the identifier word boundary
rgalonso added a commit to rgalonso/todo-to-issue-action that referenced this issue Nov 12, 2024
Provides a test for and the solution to GitHub
issue alstr#242. Namely, an identifier which contains
regex characters (e.g. "[TODO]") is properly
handled by having the parser look for literal
"[" and "]" characters rather than treating those
characters as part of a regex pattern. The word
boundary regex pattern '\b' does NOT properly
handle this, so a slightly different pattern is
used to identify the boundary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant