-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Bad regex for detecting SVG on Navigation Links #14334
Comments
Thanks for the issue, we will take it into consideration! Our team of engineers is busy working on many types of features, please give us time to get back to you. Feature requests that require more discussion may be closed. Read more about our feature request process on forem.dev. To our amazing contributors: issues labeled To claim an issue to work on, please leave a comment. If you've claimed the issue and need help, please ping @forem/oss. The OSS Community Manager or the engineers on OSS rotation will follow up. For full info on how to contribute, please check out our contributors guide. |
@omenking I took a quick look but I wasn't able to reproduce, can you please describe what you did and attach the media if possible? |
I think this can be fixed by giving the regex the |
@rhymes I think the problem is the current regex doesn't match any newlines, so if the SVG contains newlines in the So this matches: <svg ...> But this wont: <svg ...
...> |
@SiddharthShyniben The flag to make https://rubular.com/r/3CCXiqFPznQdkh Do you want to make a PR? 😃 |
@citizen428 Sure! I'll take this up |
* Fix regex to check svg. Fixes #14334 * Add tests
The dreaded error:
Code in question:
Testing with rubular
![Screen Shot 2021-07-26 at 9 03 10 AM](https://user-images.githubusercontent.com/7776/126993412-d9c51c0a-650b-4843-8d64-9eb9ca3a3595.png)
So the problem is that the Regex expects svg text to be all on a single line:
When exporting svg from illustrator it will sometimes insert a XML schema tag first.
Yep Single line formatting fixed it:
The text was updated successfully, but these errors were encountered: