fix: accept comas in viewbox (#1952)

PR adding support for comas in viewbox property, replacing them with space.
This commit is contained in:
Wojciech Lewicki
2023-01-03 19:56:54 +01:00
committed by GitHub
parent 1637580732
commit c1808c0978
+3 -1
View File
@@ -37,7 +37,9 @@ export default function extractViewBox(props: {
}
const params = (
Array.isArray(viewBox) ? viewBox : viewBox.trim().split(spacesRegExp)
Array.isArray(viewBox)
? viewBox
: viewBox.trim().replace(/,/g, ' ').split(spacesRegExp)
).map(Number);
if (params.length !== 4 || params.some(isNaN)) {