@pushwoosh/dumb-components 1.0.52 → 1.0.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -94,14 +94,11 @@ export function stringifyDc(dc) {
94
94
  } = dc;
95
95
  return `{${tagName}|${modifier}${defaultValue ? `|${defaultValue}` : ''}}`;
96
96
  }
97
- // This regex matches a string that starts with '{', contains at least one '|', and ends with '}'.
98
- // It captures the entire string, including the '{' and '}'.
99
- // The lookahead (?=[^}]*\|) ensures that there is at least one '|' before the closing '}'.
100
- // The regex is not greedy, so it will stop at the first '}' after the last '|'.
101
- // This means it will match strings like '{tag|modifier|default}', '{tag|modifier}', and '{tag|modifier|}'.
102
- // It will not match strings like '{tag|modifier|default}' if there is no '}' after the last '|'.
103
- // This regex is used to split the string into parts, where the parts are either text or dynamic content.
104
- const DynamicContentRegex = /(\{(?=[^}]*\|)[^}]*?})/;
97
+ // Regular expression to match dynamic content tags in the format "{tagName|modifier|defaultValue}"
98
+ // The regex captures the entire tag, including the curly braces and pipe characters
99
+ // It uses a positive lookahead to ensure that there is at least one pipe character in the tag
100
+ // This allows for the presence of a default value, but does not require it
101
+ const DynamicContentRegex = /(\{(?=[^}]*\|).*?})/;
105
102
  /**
106
103
  * Converts a string to Slate editor content, parsing dynamic content tags
107
104
  * @param value - The input string to convert
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/dumb-components",
3
- "version": "1.0.52",
3
+ "version": "1.0.53",
4
4
  "description": "React components to build Pushwoosh products",
5
5
  "main": "index.js",
6
6
  "module": "index.js",