Remove URI.js monkey-patch as fix landed in v1.18.5
See https://github.com/medialize/URI.js/issues/325
This commit is contained in:
parent
03e3444a35
commit
fa1aecdd9e
@ -17,19 +17,12 @@ const commonSchemes = [
|
|||||||
|
|
||||||
function findLinks(text) {
|
function findLinks(text) {
|
||||||
let result = [];
|
let result = [];
|
||||||
let lastPosition = 0;
|
|
||||||
|
|
||||||
// URI.withinString() identifies URIs within text, e.g. to translate them to
|
// URI.withinString() identifies URIs within text, e.g. to translate them to
|
||||||
// <a>-Tags.
|
// <a>-Tags.
|
||||||
// See https://medialize.github.io/URI.js/docs.html#static-withinString
|
// See https://medialize.github.io/URI.js/docs.html#static-withinString
|
||||||
// In our case, we store each URI encountered in a result array.
|
// In our case, we store each URI encountered in a result array.
|
||||||
URI.withinString(text, function(url, start, end) {
|
URI.withinString(text, function(url, start, end) {
|
||||||
// v-- fix: url was modified and does not match input string -> cant be mapped
|
|
||||||
if (text.indexOf(url, lastPosition) < 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// ^-- /fix: url was modified and does not match input string -> cant be mapped
|
|
||||||
|
|
||||||
// Extract the scheme of the URL detected, if there is one
|
// Extract the scheme of the URL detected, if there is one
|
||||||
const parsedScheme = URI(url).scheme().toLowerCase();
|
const parsedScheme = URI(url).scheme().toLowerCase();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user