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

Don't link issues within backquotes #4

Closed
rarkins opened this issue Jul 24, 2018 · 5 comments
Closed

Don't link issues within backquotes #4

rarkins opened this issue Jul 24, 2018 · 5 comments

Comments

@rarkins
Copy link

rarkins commented Jul 24, 2018

Do you think it's possible to somehow skip issues that are located within backquotes, e.g. not match/linkify #123 or Issues #123 and #456? Linkifying those would result in a pretty ugly output or the user, but I wonder if accurately identifying those would require stateful parsing of markdown to achieve.

@sindresorhus
Copy link
Owner

We could support #123 by just excluding matches preceded by a backtick, but the second one will be nearly impossible without doing full Markdown parsing.

@rarkins rarkins changed the title Don't like issues within backquotes Don't link issues within backquotes Jul 24, 2018
@rarkins
Copy link
Author

rarkins commented Jul 24, 2018

Would you achieve that by making it a negative match within https://github.com/sindresorhus/issue-regex though? I'm not sure escaped issues necessarily goes against that repository's goals.

@sindresorhus
Copy link
Owner

We can do it in issue-regex, but it will require backtracking which is only available in Node.js 10, see also: sindresorhus/issue-regex#3

@fregante
Copy link
Collaborator

fregante commented Sep 20, 2023

I think this module should be run on clean strings only. The string you're mentioning is a markdown string, so you should probably be using a markdown parser instead of this module (or at least parse it yourself before passing it here.)

Otherwise, why should it support backticks and not the HTML string "<code>#124</code>"? What about TeX? Or other markup?

@rarkins
Copy link
Author

rarkins commented Sep 20, 2023

This can be closed, as Renovate Bot no longer uses this library. FYI it was used against release notes as part of its efforts to identify github backlinks and escape them, so avoid "backlink spam".

@rarkins rarkins closed this as not planned Won't fix, can't repro, duplicate, stale Sep 20, 2023
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

3 participants