@caweb/html-webpack-plugin 1.4.3 → 1.4.4

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.
@@ -1 +1 @@
1
- <?php return array('dependencies' => array(), 'version' => 'f0ebc61ba83223002b3a');
1
+ <?php return array('dependencies' => array(), 'version' => '7613bf972b21543528e8');
@@ -6367,15 +6367,7 @@ __webpack_require__.r(__webpack_exports__);
6367
6367
 
6368
6368
  /* EXTERNAL LINK ICON */
6369
6369
  window.addEventListener('load', () => {
6370
- const ext = '<span class="ca-gov-icon-external-link" aria-hidden="true"></span>';
6371
-
6372
- // Check if link is external function
6373
- /**
6374
- * @param {HTMLAnchorElement} linkElement
6375
- */
6376
- function linkIsExternal(linkElement) {
6377
- return window.location.host.indexOf(linkElement.host) > -1;
6378
- }
6370
+ const ext = '<span class="ca-gov-icon-external-link" aria-hidden="true"></span><span class="sr-only">opens in a new window</span>';
6379
6371
 
6380
6372
  // Add any exceptions to not render here
6381
6373
  const cssExceptions = `:not(code *):not(.cagov-logo)`;
@@ -6384,11 +6376,8 @@ window.addEventListener('load', () => {
6384
6376
  /** @type {NodeListOf<HTMLAnchorElement>} */
6385
6377
  const externalLink = document.querySelectorAll(`main a${cssExceptions}, .footer-links a${cssExceptions}`);
6386
6378
  externalLink.forEach(element => {
6387
- const anchorLink = element.href.indexOf('#') === 0;
6388
- const localHost = element.href.indexOf('localhost') > -1;
6389
- const localEmail = element.href.indexOf('@') > -1;
6390
6379
  const linkElement = element;
6391
- if (linkIsExternal(linkElement) === false && !anchorLink && !localEmail && !localHost) {
6380
+ if ('_blank' === element.getAttribute('target')) {
6392
6381
  linkElement.innerHTML += ext; // += concatenates to external links
6393
6382
  }
6394
6383
  });