mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
feat: shorten image url length
This commit is contained in:
@@ -73,8 +73,8 @@ const Editor = forwardRef((props: Props, ref: React.ForwardedRef<EditorRefAction
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const resource = await resourceService.upload(file);
|
const image = await resourceService.upload(file);
|
||||||
const url = `https://memos.justsven.top/r/${resource.id}/${resource.filename}`;
|
const url = `/r/${image.id}/${image.filename}`;
|
||||||
|
|
||||||
const prevValue = editorRef.current.value;
|
const prevValue = editorRef.current.value;
|
||||||
editorRef.current.value =
|
editorRef.current.value =
|
||||||
|
@@ -17,7 +17,7 @@ export const TAG_REG = /#\s(.+?)\s/g;
|
|||||||
export const LINK_REG = /(https?:\/\/[^\s<\\*>']+)/g;
|
export const LINK_REG = /(https?:\/\/[^\s<\\*>']+)/g;
|
||||||
|
|
||||||
// 图片 正则
|
// 图片 正则
|
||||||
export const IMAGE_URL_REG = /(https?:\/\/[^\s<\\*>']+\.(jpeg|jpg|gif|png|svg))/g;
|
export const IMAGE_URL_REG = /([^\s<\\*>']+\.(jpeg|jpg|gif|png|svg))/g;
|
||||||
|
|
||||||
// memo 关联正则
|
// memo 关联正则
|
||||||
export const MEMO_LINK_REG = /\[@(.+?)\]\((.+?)\)/g;
|
export const MEMO_LINK_REG = /\[@(.+?)\]\((.+?)\)/g;
|
||||||
|
Reference in New Issue
Block a user