mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
fixes and closes #920
This commit is contained in:
parent
4db74176da
commit
5761c7ca62
|
@ -549,11 +549,10 @@ showdown.helper.isAbsolutePath = function (path) {
|
|||
};
|
||||
|
||||
showdown.helper.URLUtils = function (url, baseURL) {
|
||||
const pattern1 = /^\s+|\s+$/g;
|
||||
const pattern2 = /^([^:\/?#]+:)?(?:\/\/(?:([^:@\/?#]*)(?::([^:@\/?#]*))?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/;
|
||||
|
||||
let m = String(url)
|
||||
.replace(pattern1, '')
|
||||
.trim()
|
||||
.match(pattern2);
|
||||
if (!m) {
|
||||
throw new RangeError();
|
||||
|
|
Loading…
Reference in New Issue
Block a user