Color-stop matching fails with TypeError due to faulty regexp
See original GitHub issueI’m seeing a TypeError
when using color keywords (e.g. transparent
, as opposed to rgb()
values) since matching against the “step” regex in LinearGradientContainer
will always return null
in that case (see this line).
Can you please update the regexp to work as expected with both [a-z]+
color keywords as well as the rgb()
/rgba()
functional notation? Or would you be open to a pull request that does just that? (I can even add hsl()
/hsla()
support to the regexp, if you want…) Thanks!
Issue Analytics
- State:
- Created 9 years ago
- Comments:29 (25 by maintainers)
Top Results From Across the Web
path-to-regexp not matching when passing arguments as ...
I've run into a odd problem. When I try to test if path-to-regexp will match a given path I will not get a...
Read more >RegExp - JavaScript - MDN Web Docs - Mozilla
Chrome Edge
RegExp Full support. Chrome1. Toggle history Full support. Edge12. Toggle history
@@match Full support. Chrome50. Toggle history Full support. Edge13. Toggle history
@@matchAll Full...
Read more >path-to-regexp - npm
Start using path-to-regexp in your project by running `npm i ... (default: false ); end When true the regexp will match to the...
Read more >43 Regular expressions ( RegExp ) - Exploring JS
One important use case for match indices are parsers that point to where exactly a syntactic error is located. The following code solves...
Read more >Best Practices for Regular Expressions in .NET - Microsoft Learn
Text that matches the regular expression pattern. Text that doesn't match the regular ... To solve this problem, you can do the following:....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@usmonster @niklasvh Hello guys I know this issue is closed but I am using the latest version of html2canvas and I am getting the same error in Chrome latest version but in Firefox it is working.
html2canvas.js:formatted:1377 Uncaught (in promise) TypeError: Cannot read property ‘1’ of null at LinearGradientContainer.<anonymous> (html2canvas.js:formatted:1377) at Array.map (<anonymous>) at new LinearGradientContainer (html2canvas.js:formatted:1374) at ImageLoader.loadImage (html2canvas.js:formatted:1256) at ImageLoader.<anonymous> (html2canvas.js:formatted:1227) at Array.forEach (<anonymous>) at ImageLoader.<anonymous> (html2canvas.js:formatted:1225) at Array.forEach (<anonymous>) at ImageLoader.findBackgroundImage (html2canvas.js:formatted:1219) at html2canvas.js:formatted:2563
Hi @Observer999! This issue is closed. Please search for a similar open issue or create a new issue with a link to a page that reproduces the issue you’re having. (Please also specify there which version of Firefox you’ve tested in.) I can imagine it might have something to do with the TODOs in the code… Thanks!