diff --git a/src/Linkifier.ts b/src/Linkifier.ts index d97f4d14..07573421 100644 --- a/src/Linkifier.ts +++ b/src/Linkifier.ts @@ -74,24 +74,19 @@ export class Linkifier { return; } - console.log('found uri: ' + uri); const linkElement = this._createAnchorElement(uri); // TODO: Check if childNodes check is needed if (node.textContent.trim().length === uri.length) { // Matches entire string - console.log('match entire string'); if (node.nodeType === Node.TEXT_NODE) { - console.log('text node'); this._replaceNode(node, linkElement); } else { - console.log('element'); const element = (node); element.innerHTML = ''; element.appendChild(linkElement); } } else { // Matches part of string - console.log('part of string'); this._replaceNodeSubstringWithNode(node, linkElement, uri, searchIndex); } } @@ -167,19 +162,16 @@ export class Linkifier { if (substringIndex === 0) { // Replace with - console.log('Replace with '); const rightText = fullText.substring(substring.length); const rightTextNode = document.createTextNode(rightText); this._replaceNode(node, newNode, rightTextNode); } else if (substringIndex === targetNode.textContent.length - substring.length) { // Replace with - console.log('Replace with '); const leftText = fullText.substring(0, substringIndex); const leftTextNode = document.createTextNode(leftText); this._replaceNode(node, leftTextNode, newNode); } else { // Replace with - console.log('Replace with '); const leftText = fullText.substring(0, substringIndex); const leftTextNode = document.createTextNode(leftText); const rightText = fullText.substring(substringIndex + substring.length);