@dolphinweex/weex-vue-render 0.2.93 → 0.2.95

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.
@@ -5122,6 +5122,7 @@ var style = {
5122
5122
  }
5123
5123
  // 辅助函数:将kebab-case转换为camelCase
5124
5124
  const kebabToCamel = (str) => {
5125
+ if (str.startsWith('--')) return str;
5125
5126
  return str.replace(/-([a-z])/g, (match, letter) => letter.toUpperCase())
5126
5127
  }
5127
5128
 
@@ -5851,22 +5852,34 @@ function getImage(weex) {
5851
5852
  return path + processedAppendStr;
5852
5853
  },
5853
5854
  checkTrim(url) {
5854
- try{
5855
+ try {
5855
5856
  // 检查URL是否有效
5856
5857
  if (!url || url === 'undefined') {
5857
5858
  return '';
5858
5859
  }
5860
+
5861
+ // 处理 base64 中的换行符
5862
+ if (url.indexOf('data:') === 0) {
5863
+ const commaIndex = url.indexOf(',');
5864
+ if (commaIndex !== -1) {
5865
+ const header = url.substring(0, commaIndex + 1);
5866
+ const data = url.substring(commaIndex + 1).replace(/[\r\n\s]/g, '');
5867
+ return header + data;
5868
+ }
5869
+ return url.replace(/[\r\n\s]/g, '');
5870
+ }
5871
+
5859
5872
  // 编码空格与括号,避免 CSS url() 与资源解析失败
5860
5873
  if (url.includes(' ') || url.includes('(') || url.includes(')')) {
5861
5874
  let processed = url.replace(/\s/g, match => encodeURIComponent(match));
5862
5875
  processed = processed.replace(/\(/g, '%28').replace(/\)/g, '%29');
5863
- return processed
5876
+ return processed;
5864
5877
  }
5865
- }catch(e){
5878
+ } catch(e) {
5866
5879
  // 静默处理错误,返回空字符串
5867
5880
  return '';
5868
5881
  }
5869
- return url
5882
+ return url;
5870
5883
  },
5871
5884
 
5872
5885
  harmonyTouchStart(event){
package/package.json CHANGED
@@ -49,5 +49,5 @@
49
49
  "type": "git",
50
50
  "url": "git+ssh://git@github.com/weexteam/weex-vue-render.git"
51
51
  },
52
- "version": "0.2.93"
52
+ "version": "0.2.95"
53
53
  }