mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-23 15:09:46 +00:00
修复外链编译打包问题
This commit is contained in:
@@ -47,7 +47,12 @@ export const memorize = Component => {
|
||||
return memo(MemoizedComponent)
|
||||
}
|
||||
|
||||
// 转换外链
|
||||
/**
|
||||
* 诸如 article/https://test.com 等被错误拼接前缀的slug进行处理
|
||||
* 转换为 https://test.com
|
||||
* @param {*} str
|
||||
* @returns
|
||||
*/
|
||||
export function sliceUrlFromHttp(str) {
|
||||
// 检查字符串是否包含http
|
||||
if (str?.includes('http:') || str?.includes('https:')) {
|
||||
@@ -99,7 +104,7 @@ export function checkStartWithHttp(str) {
|
||||
// 检查字符串是否包含http
|
||||
if (str?.indexOf('http:') === 0 || str?.indexOf('https:') === 0) {
|
||||
// 如果包含,找到http的位置
|
||||
return str?.indexOf('http') > -1
|
||||
return true
|
||||
} else {
|
||||
// 不包含
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user