Fixes #1204
This commit is contained in:
parent
6a5a502d58
commit
b039398a73
|
@ -7,6 +7,7 @@
|
||||||
- #1063 URLs in the topic / subject are not clickable
|
- #1063 URLs in the topic / subject are not clickable
|
||||||
- #1190 MUC Participants column disappears in certain viewport widths
|
- #1190 MUC Participants column disappears in certain viewport widths
|
||||||
- #1199 Can't get back from to login screen from registration screen
|
- #1199 Can't get back from to login screen from registration screen
|
||||||
|
- #1204 Link encoding issue
|
||||||
- #1214 Setting `allow_contact_requests` to `false` has no effect
|
- #1214 Setting `allow_contact_requests` to `false` has no effect
|
||||||
- #1222 Adding a bookmark should prefill the room name
|
- #1222 Adding a bookmark should prefill the room name
|
||||||
|
|
||||||
|
|
7
dist/converse.js
vendored
7
dist/converse.js
vendored
|
@ -81570,10 +81570,6 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
||||||
return string.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
return string.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
||||||
};
|
};
|
||||||
|
|
||||||
u.escapeURL = function (url) {
|
|
||||||
return encodeURI(decodeURI(url)).replace(/[!'()]/g, escape).replace(/\*/g, "%2A");
|
|
||||||
};
|
|
||||||
|
|
||||||
u.prefixMentions = function (message) {
|
u.prefixMentions = function (message) {
|
||||||
/* Given a message object, return its text with @ chars
|
/* Given a message object, return its text with @ chars
|
||||||
* inserted before the mentioned nicknames.
|
* inserted before the mentioned nicknames.
|
||||||
|
@ -81607,14 +81603,13 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
||||||
u.addHyperlinks = function (text) {
|
u.addHyperlinks = function (text) {
|
||||||
return URI.withinString(text, url => {
|
return URI.withinString(text, url => {
|
||||||
const uri = new URI(url);
|
const uri = new URI(url);
|
||||||
uri.normalize();
|
url = uri.normalize()._string;
|
||||||
const pretty_url = uri._parts.urn ? url : uri.readable();
|
const pretty_url = uri._parts.urn ? url : uri.readable();
|
||||||
|
|
||||||
if (!uri._parts.protocol && !url.startsWith('http://') && !url.startsWith('https://')) {
|
if (!uri._parts.protocol && !url.startsWith('http://') && !url.startsWith('https://')) {
|
||||||
url = 'http://' + url;
|
url = 'http://' + url;
|
||||||
}
|
}
|
||||||
|
|
||||||
url = u.escapeHTML(u.escapeURL(url));
|
|
||||||
return `<a target="_blank" rel="noopener" href="${url}">${u.escapeHTML(pretty_url)}</a>`;
|
return `<a target="_blank" rel="noopener" href="${url}">${u.escapeHTML(pretty_url)}</a>`;
|
||||||
}, {
|
}, {
|
||||||
'start': /\b(?:([a-z][a-z0-9.+-]*:\/\/)|xmpp:|mailto:|www\.)/gi
|
'start': /\b(?:([a-z][a-z0-9.+-]*:\/\/)|xmpp:|mailto:|www\.)/gi
|
||||||
|
|
|
@ -228,10 +228,6 @@
|
||||||
.replace(/"/g, """);
|
.replace(/"/g, """);
|
||||||
};
|
};
|
||||||
|
|
||||||
u.escapeURL = function (url) {
|
|
||||||
return encodeURI(decodeURI(url)).replace(/[!'()]/g, escape).replace(/\*/g, "%2A");
|
|
||||||
};
|
|
||||||
|
|
||||||
u.prefixMentions = function (message) {
|
u.prefixMentions = function (message) {
|
||||||
/* Given a message object, return its text with @ chars
|
/* Given a message object, return its text with @ chars
|
||||||
* inserted before the mentioned nicknames.
|
* inserted before the mentioned nicknames.
|
||||||
|
@ -267,12 +263,11 @@
|
||||||
u.addHyperlinks = function (text) {
|
u.addHyperlinks = function (text) {
|
||||||
return URI.withinString(text, url => {
|
return URI.withinString(text, url => {
|
||||||
const uri = new URI(url);
|
const uri = new URI(url);
|
||||||
uri.normalize();
|
url = uri.normalize()._string;
|
||||||
const pretty_url = uri._parts.urn ? url : uri.readable();
|
const pretty_url = uri._parts.urn ? url : uri.readable();
|
||||||
if (!uri._parts.protocol && !url.startsWith('http://') && !url.startsWith('https://')) {
|
if (!uri._parts.protocol && !url.startsWith('http://') && !url.startsWith('https://')) {
|
||||||
url = 'http://' + url;
|
url = 'http://' + url;
|
||||||
}
|
}
|
||||||
url = u.escapeHTML(u.escapeURL(url));
|
|
||||||
return `<a target="_blank" rel="noopener" href="${url}">${u.escapeHTML(pretty_url)}</a>`;
|
return `<a target="_blank" rel="noopener" href="${url}">${u.escapeHTML(pretty_url)}</a>`;
|
||||||
}, {
|
}, {
|
||||||
'start': /\b(?:([a-z][a-z0-9.+-]*:\/\/)|xmpp:|mailto:|www\.)/gi
|
'start': /\b(?:([a-z][a-z0-9.+-]*:\/\/)|xmpp:|mailto:|www\.)/gi
|
||||||
|
|
Loading…
Reference in New Issue
Block a user