Skip to content
This repository was archived by the owner on Jul 10, 2019. It is now read-only.

Commit 59dc200

Browse files
author
Tankred Hase
committed
Fix regex for creating anchors from urls in reader
1 parent 10cd279 commit 59dc200

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/js/controller/app/read-sandbox.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ function renderNodes(root) {
156156
var lines = node.split('\n');
157157
for (i = 0; i < lines.length; i++) {
158158
// replace all urls with anchors
159-
lines[i] = lines[i].replace(/(https?:\/\/[^\s]+)/g, createArchor);
159+
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);
160160
// wrap line into an element for easier styling
161161
html += '<div class="line';
162162
if (isLineEmpty(lines[i])) {

0 commit comments

Comments
 (0)