feat: Markdown Editor Keyboard Shortcuts (#2763)

* Add bold and italic keyboard shortcut

* Add hyperlink keyboard shortcut support
This commit is contained in:
Noah Alderton
2024-01-15 04:19:59 -08:00
committed by GitHub
parent cd3a98c095
commit 728a9705ea
2 changed files with 54 additions and 0 deletions

View File

@ -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;
}
};