mirror of
https://github.com/haiwen/seahub.git
synced 2025-06-27 15:37:43 +00:00
parent
339a149c0c
commit
ae9e109c46
@ -60,7 +60,7 @@ class LongtextAPI {
|
||||
|
||||
isInternalDirLink(url) {
|
||||
// eslint-disable-next-line
|
||||
var re = new RegExp(this.serviceUrl + '/library/' + '[0-9a-f\-]{36}.*');
|
||||
var re = new RegExp(this.serviceUrl + '/library/' + '[0-9a-f-]{36}.*');
|
||||
return re.test(url);
|
||||
}
|
||||
|
||||
|
@ -95,7 +95,7 @@ class EditorApi {
|
||||
|
||||
isInternalDirLink(url) {
|
||||
// eslint-disable-next-line
|
||||
var re = new RegExp(serviceUrl + '/library/' + '[0-9a-f\-]{36}.*');
|
||||
var re = new RegExp(serviceUrl + '/library/' + '[0-9a-f-]{36}.*');
|
||||
return re.test(url);
|
||||
}
|
||||
|
||||
|
@ -1088,7 +1088,7 @@ export const Utils = {
|
||||
|
||||
isInternalMarkdownLink: function (url, repoID) {
|
||||
// eslint-disable-next-line
|
||||
var re = new RegExp(serviceURL + '/lib/' + repoID + '.*\.md$');
|
||||
var re = new RegExp(serviceURL + '/lib/' + repoID + '.*(\\.md)$');
|
||||
return re.test(url);
|
||||
},
|
||||
|
||||
@ -1099,7 +1099,7 @@ export const Utils = {
|
||||
|
||||
getPathFromInternalMarkdownLink: function (url, repoID) {
|
||||
// eslint-disable-next-line
|
||||
var re = new RegExp(serviceURL + '/lib/' + repoID + '/file' + '(.*\.md)');
|
||||
var re = new RegExp(serviceURL + '/lib/' + repoID + '/file' + '.*(\\.md)$');
|
||||
var array = re.exec(url);
|
||||
var path = decodeURIComponent(array[1]);
|
||||
return path;
|
||||
@ -1117,7 +1117,7 @@ export const Utils = {
|
||||
isWikiInternalMarkdownLink: function (url, slug) {
|
||||
slug = encodeURIComponent(slug);
|
||||
// eslint-disable-next-line
|
||||
var re = new RegExp(serviceURL + '/published/' + slug + '.*\.md$');
|
||||
var re = new RegExp(serviceURL + '/published/' + slug + '.*(\\.md)$');
|
||||
return re.test(url);
|
||||
},
|
||||
|
||||
@ -1130,7 +1130,7 @@ export const Utils = {
|
||||
getPathFromWikiInternalMarkdownLink: function (url, slug) {
|
||||
slug = encodeURIComponent(slug);
|
||||
// eslint-disable-next-line
|
||||
var re = new RegExp(serviceURL + '/published/' + slug + '(.*\.md)');
|
||||
var re = new RegExp(serviceURL + '/published/' + slug + '.*(\\.md)$');
|
||||
var array = re.exec(url);
|
||||
var path = array[1];
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user