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

Regexp escape for ! is missing and causes missing images #473

Closed
MartenBE opened this issue Jan 4, 2024 · 5 comments
Closed

Regexp escape for ! is missing and causes missing images #473

MartenBE opened this issue Jan 4, 2024 · 5 comments

Comments

@MartenBE
Copy link
Contributor

MartenBE commented Jan 4, 2024

See be81101#commitcomment-136249062

@webpro
Copy link
Owner

webpro commented Jan 4, 2024

The ! is not a special regex character? My linter was complaining about it being unnecessarily escaped.

@vvscode
Copy link
Contributor

vvscode commented Jan 5, 2024

looks like we need some screenshot tests =)

@MartenBE
Copy link
Contributor Author

MartenBE commented Jan 5, 2024

Sorry, there is a mistake in the regex I introduced, but it is not the ! char, it is the following: the regexp currently only copies images with an alt explanatation because I used + instead of * in the regexp:

Current regexp: const htmlImageRE = /!\[.+?\]\((.+?)\)/g;
Should be: const htmlImageRE = /!\[.*?\]\((.+?)\)/g;

@MartenBE
Copy link
Contributor Author

MartenBE commented Jan 5, 2024

PR created at #474

@webpro
Copy link
Owner

webpro commented Jan 8, 2024

No need to apologize! Thanks for the fix.

@MartenBE MartenBE closed this as completed Jan 9, 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

3 participants