react-ai-renderer 0.1.17 → 0.1.18

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.
package/dist/index.js CHANGED
@@ -763,7 +763,8 @@ var MDXStreamingParser = /** @class */function () {
763
763
  return "\"".concat(inner, "\"");
764
764
  });
765
765
  // 2. 为对象键名添加引号(如果还没有引号)
766
- jsonValue = jsonValue.replace(/([{,]\s*)([a-zA-Z_$][a-zA-Z0-9_$]*)\s*:/g, '$1"$2":');
766
+ // 修复:使用 \p{L} 匹配 Unicode 字母(包括中文),使用 u 标志
767
+ jsonValue = jsonValue.replace(/([{,]\s*)([\p{L}_$][\p{L}\p{N}_$]*)\s*:/gu, '$1"$2":');
767
768
  // 3. 处理属性值中的模板字符串
768
769
  jsonValue = jsonValue.replace(/`([^`]*)`/g, function (match, p1) {
769
770
  return JSON.stringify(p1);