mirror of
https://github.com/usememos/memos.git
synced 2024-12-26 07:01:17 +08:00
feat: shorten image url length
This commit is contained in:
parent
ee3c753c99
commit
3fc74490de
2 changed files with 3 additions and 3 deletions
|
@ -73,8 +73,8 @@ const Editor = forwardRef((props: Props, ref: React.ForwardedRef<EditorRefAction
|
|||
return;
|
||||
}
|
||||
|
||||
const resource = await resourceService.upload(file);
|
||||
const url = `https://memos.justsven.top/r/${resource.id}/${resource.filename}`;
|
||||
const image = await resourceService.upload(file);
|
||||
const url = `/r/${image.id}/${image.filename}`;
|
||||
|
||||
const prevValue = 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 IMAGE_URL_REG = /(https?:\/\/[^\s<\\*>']+\.(jpeg|jpg|gif|png|svg))/g;
|
||||
export const IMAGE_URL_REG = /([^\s<\\*>']+\.(jpeg|jpg|gif|png|svg))/g;
|
||||
|
||||
// memo 关联正则
|
||||
export const MEMO_LINK_REG = /\[@(.+?)\]\((.+?)\)/g;
|
||||
|
|
Loading…
Reference in a new issue