mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-03 07:32:23 +08:00
This commit is contained in:
parent
30497dd942
commit
f5fced6bb4
@ -34,7 +34,11 @@ export const validateName = (name: string, targetElement?: HTMLElement) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const replaceFileName = (name: string) => {
|
export const replaceFileName = (name: string) => {
|
||||||
return name.replace(/\r\n|\r|\n|\u2028|\u2029|\t|/g, "").replace(/\//g, "/").substring(0, Constants.SIZE_TITLE);
|
if (name.indexOf("/") > -1) {
|
||||||
|
showMessage(window.siyuan.languages.fileNameRule);
|
||||||
|
name = name.replace(/\//g, "/");
|
||||||
|
}
|
||||||
|
return name.replace(/\r\n|\r|\n|\u2028|\u2029|\t|/g, "").substring(0, Constants.SIZE_TITLE);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const replaceLocalPath = (name: string) => {
|
export const replaceLocalPath = (name: string) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user