Fix regex for creating anchors from urls in reader

master
Tankred Hase 2015-02-16 21:53:41 +01:00
parent 10cd2795f3
commit 59dc2008a4
1 changed files with 1 additions and 1 deletions

View File

@ -156,7 +156,7 @@ function renderNodes(root) {
var lines = node.split('\n');
for (i = 0; i < lines.length; i++) {
// replace all urls with anchors
lines[i] = lines[i].replace(/(https?:\/\/[^\s]+)/g, createArchor);
lines[i] = lines[i].replace(/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)/g, createArchor);
// wrap line into an element for easier styling
html += '<div class="line';
if (isLineEmpty(lines[i])) {