diff --git a/frontend/src/metadata/components/cell-editors/long-text-editor/api.js b/frontend/src/metadata/components/cell-editors/long-text-editor/api.js index 952b369794..ce92539069 100644 --- a/frontend/src/metadata/components/cell-editors/long-text-editor/api.js +++ b/frontend/src/metadata/components/cell-editors/long-text-editor/api.js @@ -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); } diff --git a/frontend/src/pages/markdown-editor/editor-api.js b/frontend/src/pages/markdown-editor/editor-api.js index 038903ac8a..b858bfabfe 100644 --- a/frontend/src/pages/markdown-editor/editor-api.js +++ b/frontend/src/pages/markdown-editor/editor-api.js @@ -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); } diff --git a/frontend/src/utils/utils.js b/frontend/src/utils/utils.js index 7aac7e2251..1cf61158d3 100644 --- a/frontend/src/utils/utils.js +++ b/frontend/src/utils/utils.js @@ -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 {