diff --git a/addons/linkify/linkify.js b/addons/linkify/linkify.js index 543e5feb..61cadb99 100644 --- a/addons/linkify/linkify.js +++ b/addons/linkify/linkify.js @@ -7,14 +7,14 @@ } else { /* * Plain browser environment - */ + */ linkify(this.Xterm); } })(function (Xterm) { 'use strict'; /** - * This module provides methods for convertings valid URL substrings + * This module provides methods for convertings valid URL substrings * into HTML anchor elements (links), inside a terminal view. * * @module xterm/addons/linkify/linkify @@ -31,8 +31,11 @@ bodyClause = hostClause + pathClause, start = '(?:^|' + negatedDomainCharacterSet + ')(', end = ')($|' + negatedPathCharacterSet + ')', - urlClause = start + protocolClause + '?' + bodyClause + end, - urlRegex = new RegExp(urlClause); + lenientUrlClause = start + protocolClause + '?' + bodyClause + end, + strictUrlClause = start + protocolClause + bodyClause + end, + lenientUrlRegex = new RegExp(lenientUrlClause), + strictUrlRegex = new RegExp(strictUrlClause); + /** * Converts all valid URLs found in the given terminal line into @@ -46,7 +49,7 @@ * @emits linkify * @emits linkify:line */ - exports.linkifyTerminalLine = function (terminal, line) { + exports.linkifyTerminalLine = function (terminal, line, lenient) { if (typeof line == 'number') { line = terminal.rowContainer.children[line]; } else if (! (line instanceof HTMLDivElement)) { @@ -60,7 +63,8 @@ nodes = line.childNodes; for (var j=0; j