1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-06-27 15:37:43 +00:00
Co-authored-by: 杨国璇 <ygx@Hello-word.local>
This commit is contained in:
杨国璇 2025-03-17 12:50:50 +08:00 committed by GitHub
parent 339a149c0c
commit ae9e109c46
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 6 deletions

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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 {