Skip to content

Commit b40c752

Browse files
[project-base] grapesjs product catnums field is now text input (#2994)
1 parent 0a1cd2c commit b40c752

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/Component/GrapesJs/GrapesJsParser.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ public function parse(?string $text): ?string
2525
}
2626

2727
$newText = preg_replace_callback(static::GJS_PRODUCTS_REGEX, static function (array $matches): string {
28-
preg_match('/data-products="(.+?)"/', $matches[0], $productMatches);
28+
$gjsProductsDiv = str_replace(["\r", "\n", "\r\n"], '', $matches[0]);
29+
preg_match('/data-products="(.+?)"/', $gjsProductsDiv, $productMatches);
2930
$productArray = explode(',', $productMatches[1]);
3031
$trimmedProductArray = array_map(static fn ($product) => trim($product), $productArray);
3132
$productCatnumsString = implode(',', $trimmedProductArray);

0 commit comments

Comments
 (0)