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

issue URL not inserted if issue title contains regex characters #226

Closed
rgalonso opened this issue Nov 8, 2024 · 2 comments
Closed

issue URL not inserted if issue title contains regex characters #226

rgalonso opened this issue Nov 8, 2024 · 2 comments

Comments

@rgalonso
Copy link
Contributor

rgalonso commented Nov 8, 2024

If the TODO comment's first line (i.e. what will become the issue title) contains any regex characters (for example TODO: fix this (after first fixing issue #34), then the issue URL will not get properly inserted. (The line containing the TODO will just be repeated, as explained by #224/#225.)

This is happening because the re.sub() call which modifies the inserted line is not escaping the title.

@rgalonso
Copy link
Contributor Author

rgalonso commented Nov 8, 2024

@alstr, the solution is already implemented.

rgalonso added a commit to rgalonso/todo-to-issue-action that referenced this issue Nov 9, 2024
There are issues currently where the wrong text
may be inserted in place of the issue URL. (See
github.com/alstr/todo-to-issue-action issues alstr#224
, alstr#225, and alstr#226, for example.) When such a
situation is detected, the offending line is now
NOT inserted and instead a warning message is
printed out. This doesn't completely resolve
those issues, but mitigates against them and
other similar issues which may arise in the future.
rgalonso added a commit to rgalonso/todo-to-issue-action that referenced this issue Nov 9, 2024
If regex characters are part of the title (for
example, parentheses), then this breaks the ability
to find the comment line when trying to insert
the issue URL. This commit escapes the title
to fix this problem.

Closes github.com/alstr#226
@alstr
Copy link
Owner

alstr commented Nov 22, 2024

Another one I think is fixed.

@alstr alstr closed this as completed Nov 22, 2024
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

No branches or pull requests

2 participants