function(articleContent) {
    var baseURI = this._doc.baseURI;
    var documentURI = this._doc.documentURI;
    function toAbsoluteURI(uri) {
      // Leave hash links alone if the base URI matches the document URI:
      if (baseURI == documentURI && uri.charAt(0) == "#") {
        return uri;
      }
      // Otherwise, resolve against base URI:
      try {
        return new URL(uri, baseURI).href;
      } catch (ex) {
        // Something went wrong, just return the original:
      }
      return uri;
    }

    var links = articleContent.getElementsByTagName("a");
    this._forEachNode(links, function(link) {
      var href = link.getAttribute("href");
      if (href) {
        // Replace links with javascript: URIs with text content, since
        // they won't work after scripts have been removed from the page.
        if (href.indexOf("javascript:") === 0) {
          var text = this._doc.createTextNode(link.textContent);
          link.parentNode.replaceChild(text, link);
        } else {
          link.setAttribute("href", toAbsoluteURI(href));
        }
      }
    });

    var imgs = articleContent.getElementsByTagName("img");
    this._forEachNode(imgs, function(img) {
      var src = img.getAttribute("src");
      if (src) {
        img.setAttribute("src", toAbsoluteURI(src));
      }
    });
  }
function(articleContent) {
    var baseURI = this._doc.baseURI;
    var documentURI = this._doc.documentURI;
    function toAbsoluteURI(uri) {
      // Leave hash links alone if the base URI matches the document URI:
      if (baseURI == documentURI && uri.charAt(0) == "#") {
        return uri;
      }
      // Otherwise, resolve against base URI:
      try {
        return new URL(uri, baseURI).href;
      } catch (ex) {
        // Something went wrong, just return the original:
      }
      return uri;
    }

    var links = articleContent.getElementsByTagName("a");
    this._forEachNode(links, function(link) {
      var href = link.getAttribute("href");
      if (href) {
        // Replace links with javascript: URIs with text content, since
        // they won't work after scripts have been removed from the page.
        if (href.indexOf("javascript:") === 0) {
          var text = this._doc.createTextNode(link.textContent);
          link.parentNode.replaceChild(text, link);
        } else {
          link.setAttribute("href", toAbsoluteURI(href));
        }
      }
    });

    var imgs = articleContent.getElementsByTagName("img");
    this._forEachNode(imgs, function(img) {
      var src = img.getAttribute("src");
      if (src) {
        img.setAttribute("src", toAbsoluteURI(src));
      }
    });
  }
function ( articleContent ) { var baseURI = this . _doc . baseURI ; var documentURI = this . _doc . documentURI ; function toAbsoluteURI ( uri ) { // Leave hash links alone if the base URI matches the document URI: if ( baseURI == documentURI && uri . charAt ( 0 ) == "#" ) { return uri ; } // Otherwise, resolve against base URI: try { return new URL ( uri , baseURI ) . href ; } catch ( ex ) { // Something went wrong, just return the original: } return uri ; } var links = articleContent . getElementsByTagName ( "a" ) ; this . _forEachNode ( links , function ( link ) { var href = link . getAttribute ( "href" ) ; if ( href ) { // Replace links with javascript: URIs with text content, since // they won't work after scripts have been removed from the page. if ( href . indexOf ( "javascript:" ) === 0 ) { var text = this . _doc . createTextNode ( link . textContent ) ; link . parentNode . replaceChild ( text , link ) ; } else { link . setAttribute ( "href" , toAbsoluteURI ( href ) ) ; } } } ) ; var imgs = articleContent . getElementsByTagName ( "img" ) ; this . _forEachNode ( imgs , function ( img ) { var src = img . getAttribute ( "src" ) ; if ( src ) { img . setAttribute ( "src" , toAbsoluteURI ( src ) ) ; } } ) ; }
Converts each <a> and <img> uri in the given element to an absolute URI,
ignoring #ref URIs.

@param Element
@return void
Converts each <a > and <img > uri in the given element to an absolute URI ignoring #ref URIs .
This function is called by the articleParser when the article is parsed.