mirror of https://github.com/moparisthebest/mail
Fix regex for creating anchors from urls in reader
This commit is contained in:
parent
10cd2795f3
commit
59dc2008a4
|
@ -156,7 +156,7 @@ function renderNodes(root) {
|
||||||
var lines = node.split('\n');
|
var lines = node.split('\n');
|
||||||
for (i = 0; i < lines.length; i++) {
|
for (i = 0; i < lines.length; i++) {
|
||||||
// replace all urls with anchors
|
// 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
|
// wrap line into an element for easier styling
|
||||||
html += '<div class="line';
|
html += '<div class="line';
|
||||||
if (isLineEmpty(lines[i])) {
|
if (isLineEmpty(lines[i])) {
|
||||||
|
|
Loading…
Reference in New Issue