mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
feat: Markdown Editor Keyboard Shortcuts (#2763)
* Add bold and italic keyboard shortcut * Add hyperlink keyboard shortcut support
This commit is contained in:
@ -83,3 +83,12 @@ export const formatBytes = (bytes: number) => {
|
||||
i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + " " + sizes[i];
|
||||
};
|
||||
|
||||
export const isValidUrl = (url: string): boolean => {
|
||||
try {
|
||||
new URL(url);
|
||||
return true;
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user