@dolphinweex/weex-vue-render 0.2.93 → 0.2.94

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.
@@ -5851,22 +5851,34 @@ function getImage(weex) {
5851
5851
  return path + processedAppendStr;
5852
5852
  },
5853
5853
  checkTrim(url) {
5854
- try{
5854
+ try {
5855
5855
  // 检查URL是否有效
5856
5856
  if (!url || url === 'undefined') {
5857
5857
  return '';
5858
5858
  }
5859
+
5860
+ // 处理 base64 中的换行符
5861
+ if (url.indexOf('data:') === 0) {
5862
+ const commaIndex = url.indexOf(',');
5863
+ if (commaIndex !== -1) {
5864
+ const header = url.substring(0, commaIndex + 1);
5865
+ const data = url.substring(commaIndex + 1).replace(/[\r\n\s]/g, '');
5866
+ return header + data;
5867
+ }
5868
+ return url.replace(/[\r\n\s]/g, '');
5869
+ }
5870
+
5859
5871
  // 编码空格与括号,避免 CSS url() 与资源解析失败
5860
5872
  if (url.includes(' ') || url.includes('(') || url.includes(')')) {
5861
5873
  let processed = url.replace(/\s/g, match => encodeURIComponent(match));
5862
5874
  processed = processed.replace(/\(/g, '%28').replace(/\)/g, '%29');
5863
- return processed
5875
+ return processed;
5864
5876
  }
5865
- }catch(e){
5877
+ } catch(e) {
5866
5878
  // 静默处理错误,返回空字符串
5867
5879
  return '';
5868
5880
  }
5869
- return url
5881
+ return url;
5870
5882
  },
5871
5883
 
5872
5884
  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.94"
53
53
  }