auto-git:

[change] src-tauri/gen/schemas/acl-manifests.json
 [change] src-tauri/gen/schemas/capabilities.json
 [change] src-tauri/gen/schemas/desktop-schema.json
 [change] src-tauri/gen/schemas/macOS-schema.json
 [change] src/App.tsx
This commit is contained in:
2026-01-31 14:31:09 +01:00
parent 9f04d11664
commit 7b1066605f
5 changed files with 656 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
import { open, save } from "@tauri-apps/plugin-dialog";
import { open as openExternal } from "@tauri-apps/plugin-shell";
import { readTextFile, writeTextFile } from "@tauri-apps/plugin-fs";
import { getCurrentWindow } from "@tauri-apps/api/window";
import { appDataDir } from "@tauri-apps/api/path";
@@ -142,6 +143,19 @@ export default function App() {
const hasText = body.trim().length > 0;
const showLineNumbersActive = showLineNumbers && !markdownPreview;
const handleMarkdownLinkClick = useCallback(
(event: React.MouseEvent<HTMLDivElement>) => {
const target = event.target as HTMLElement | null;
const link = target?.closest?.("a");
if (!link) return;
const href = link.getAttribute("href");
if (!href || href.startsWith("#") || href.startsWith("/")) return;
event.preventDefault();
openExternal(href);
},
[]
);
const statusKey = useMemo(() => {
if (isViewingHistory) return "history";
if (isDirty) return "unsaved";