@micro-zoe/micro-app 1.0.0-rc.13 → 1.0.0-rc.14

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/lib/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- const version = '1.0.0-rc.13';
1
+ const version = '1.0.0-rc.14';
2
2
  // do not use isUndefined
3
3
  const isBrowser = typeof window !== 'undefined';
4
4
  // do not use isUndefined
@@ -6459,7 +6459,9 @@ function patchIframeAttribute(url, microAppWindow) {
6459
6459
  }
6460
6460
  else {
6461
6461
  if (((key === 'src' || key === 'srcset') && /^(img|script|video|audio|source|embed)$/i.test(this.tagName)) ||
6462
- (key === 'href' && /^(a|link|image)$/i.test(this.tagName))) {
6462
+ (key === 'href' && /^(link|image)$/i.test(this.tagName)) ||
6463
+ // If it is the anchor tag,eg. <a href="#xxx"/>, the path will not be completed
6464
+ (key === 'href' && /^(a)$/i.test(this.tagName) && !/^#/.test(value))) {
6463
6465
  let _url = url;
6464
6466
  if (isBrowser && key === 'href' && /^a$/i.test(this.tagName) && isFunction(microApp.options.excludeAssetFilter) && microApp.options.excludeAssetFilter(value)) {
6465
6467
  _url = document.baseURI;
@@ -7716,7 +7718,9 @@ function completePathDynamic(app, newChild) {
7716
7718
  globalEnv.rawSetAttribute.call(newChild, 'srcset', CompletionPath(newChild.getAttribute('srcset'), app.url));
7717
7719
  }
7718
7720
  }
7719
- else if (/^(a|link|image)$/i.test(newChild.tagName) && newChild.hasAttribute('href')) {
7721
+ else if ((/^(link|image)$/i.test(newChild.tagName) && newChild.hasAttribute('href')) ||
7722
+ // If it is the anchor tag,eg. <a href="#xxx"/>, the path will not be completed
7723
+ (/^(a)$/i.test(newChild.tagName) && newChild.hasAttribute('href') && !/^#/.test(newChild.getAttribute('href') || ''))) {
7720
7724
  globalEnv.rawSetAttribute.call(newChild, 'href', CompletionPath(newChild.getAttribute('href'), app.url));
7721
7725
  }
7722
7726
  }
@@ -7891,7 +7895,9 @@ function patchElementAndDocument() {
7891
7895
  if (appName &&
7892
7896
  appInstanceMap.has(appName) &&
7893
7897
  (((key === 'src' || key === 'srcset') && /^(img|script|video|audio|source|embed)$/i.test(this.tagName)) ||
7894
- (key === 'href' && /^(a|link|image)$/i.test(this.tagName)))) {
7898
+ (key === 'href' && /^(link|image)$/i.test(this.tagName)) ||
7899
+ // If it is the anchor tag,eg. <a href="#xxx"/>, the path will not be completed
7900
+ (key === 'href' && /^(a)$/i.test(this.tagName) && !/^#/.test(value)))) {
7895
7901
  const app = appInstanceMap.get(appName);
7896
7902
  value = CompletionPath(value, app.url);
7897
7903
  }