An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:sparkles: Support visible image descriptions and richer tooltips https://github.com/siyuan-note/siyuan/issues/19979
Daniel38a681fe5cee
diff --git a/app/appearance/langs/ar.json b/app/appearance/langs/ar.jsonindex 0ab256efe1..0bda5ff57c 100644--- a/app/appearance/langs/ar.json+++ b/app/appearance/langs/ar.json@@ -1,4 +1,5 @@{+ "displayImgAlt": "إظهار نص تلميحات الصور","displayImgName": "إظهار أسماء ملفات الصور","s3EndpointBucketWarning": "قد يحتوي Endpoint بالفعل على اسم الحاوية، مما قد يعطل عرض لقطات السحابة وتنظيفها. تحقق من الإعدادات؛ إذا كانت هناك بيانات متزامنة، فانسخها احتياطيًا وتحقق من مسار تخزينها قبل تغيير الإعدادات","embedHTMLFileBelow": "تضمين ملف HTML أدناه",diff --git a/app/appearance/langs/de.json b/app/appearance/langs/de.jsonindex 39585c39c1..45bfa2b48c 100644--- a/app/appearance/langs/de.json+++ b/app/appearance/langs/de.json@@ -1,4 +1,5 @@{+ "displayImgAlt": "Bildhinweistext anzeigen","displayImgName": "Bilddateinamen anzeigen","s3EndpointBucketWarning": "Endpoint enthält möglicherweise bereits den Bucket-Namen, was das Auflisten und Bereinigen von Cloud-Snapshots beeinträchtigen kann. Prüfen Sie die Konfiguration; sichern Sie vorhandene synchronisierte Daten und prüfen Sie deren Speicherpfad, bevor Sie die Konfiguration ändern","embedHTMLFileBelow": "HTML-Datei darunter einbetten",diff --git a/app/appearance/langs/en.json b/app/appearance/langs/en.jsonindex a4b97829ab..7cceec1772 100644--- a/app/appearance/langs/en.json+++ b/app/appearance/langs/en.json@@ -1,4 +1,5 @@{+ "displayImgAlt": "Show image tooltip text","displayImgName": "Show image file names","s3EndpointBucketWarning": "Endpoint may already contain the bucket name, which can disrupt cloud snapshot listing and cleanup. Check the configuration; if synced data already exists, back it up and verify its storage path before changing the configuration","embedHTMLFileBelow": "Embed HTML file below",diff --git a/app/appearance/langs/es.json b/app/appearance/langs/es.jsonindex 0898599bfa..a2bc717b26 100644--- a/app/appearance/langs/es.json+++ b/app/appearance/langs/es.json@@ -1,4 +1,5 @@{+ "displayImgAlt": "Mostrar el texto de ayuda de las imágenes","displayImgName": "Mostrar nombres de archivos de imagen","s3EndpointBucketWarning": "Endpoint puede contener ya el nombre del bucket, lo que puede afectar al listado y la limpieza de instantáneas en la nube. Revise la configuración; si ya hay datos sincronizados, haga una copia de seguridad y compruebe su ruta de almacenamiento antes de cambiarla","embedHTMLFileBelow": "Incrustar archivo HTML debajo",diff --git a/app/appearance/langs/fr.json b/app/appearance/langs/fr.jsonindex b7c457f01c..4221e537a0 100644--- a/app/appearance/langs/fr.json+++ b/app/appearance/langs/fr.json@@ -1,4 +1,5 @@{+ "displayImgAlt": "Afficher le texte d’infobulle des images","displayImgName": "Afficher les noms des fichiers image","s3EndpointBucketWarning": "Endpoint contient peut-être déjà le nom du bucket, ce qui peut perturber la liste et le nettoyage des instantanés cloud. Vérifiez la configuration ; si des données sont déjà synchronisées, sauvegardez-les et vérifiez leur chemin de stockage avant de modifier la configuration","embedHTMLFileBelow": "Intégrer le fichier HTML en dessous",diff --git a/app/appearance/langs/he.json b/app/appearance/langs/he.jsonindex 56bd41b259..2b7136bfce 100644--- a/app/appearance/langs/he.json+++ b/app/appearance/langs/he.json@@ -1,4 +1,5 @@{+ "displayImgAlt": "הצגת טקסט תיאור של תמונות","displayImgName": "הצגת שמות קובצי תמונות","s3EndpointBucketWarning": "ייתכן ש-Endpoint כבר מכיל את שם דלי האחסון, דבר שעלול לשבש הצגה וניקוי של תמונות מצב בענן. יש לבדוק את ההגדרות; אם קיימים נתונים מסונכרנים, יש לגבות אותם ולוודא את נתיב האחסון לפני שינוי ההגדרות","embedHTMLFileBelow": "הטמעת קובץ HTML מתחת",diff --git a/app/appearance/langs/hi.json b/app/appearance/langs/hi.jsonindex 02a4a019e4..f6f69bcf1a 100644--- a/app/appearance/langs/hi.json+++ b/app/appearance/langs/hi.json@@ -1,4 +1,5 @@{+ "displayImgAlt": "चित्रों का टूलटिप पाठ दिखाएँ","displayImgName": "चित्र फ़ाइलों के नाम दिखाएँ","s3EndpointBucketWarning": "Endpoint में बकेट का नाम पहले से शामिल हो सकता है, जिससे क्लाउड स्नैपशॉट की सूची और सफ़ाई में समस्या आ सकती है। कॉन्फ़िगरेशन जाँचें; यदि सिंक किया गया डेटा मौजूद है, तो कॉन्फ़िगरेशन बदलने से पहले उसका बैकअप लें और संग्रहण पथ की पुष्टि करें","embedHTMLFileBelow": "नीचे HTML फ़ाइल एम्बेड करें",diff --git a/app/appearance/langs/id.json b/app/appearance/langs/id.jsonindex d416e0b91d..85bbe9ced7 100644--- a/app/appearance/langs/id.json+++ b/app/appearance/langs/id.json@@ -1,4 +1,5 @@{+ "displayImgAlt": "Tampilkan teks keterangan gambar","displayImgName": "Tampilkan nama berkas gambar","s3EndpointBucketWarning": "Endpoint mungkin sudah memuat nama bucket, sehingga daftar dan pembersihan snapshot cloud dapat terganggu. Periksa konfigurasi; jika sudah ada data tersinkron, cadangkan dan pastikan jalur penyimpanannya sebelum mengubah konfigurasi","embedHTMLFileBelow": "Sematkan berkas HTML di bawah",diff --git a/app/appearance/langs/it.json b/app/appearance/langs/it.jsonindex 296ba92a45..5038d973fd 100644--- a/app/appearance/langs/it.json+++ b/app/appearance/langs/it.json@@ -1,4 +1,5 @@{+ "displayImgAlt": "Mostra il testo dei suggerimenti delle immagini","displayImgName": "Mostra i nomi dei file immagine","s3EndpointBucketWarning": "Endpoint potrebbe già contenere il nome del bucket, causando problemi nell'elenco e nella pulizia delle istantanee nel cloud. Controlla la configurazione; se esistono già dati sincronizzati, esegui un backup e verifica il percorso di archiviazione prima di modificarla","embedHTMLFileBelow": "Incorpora file HTML sotto",diff --git a/app/appearance/langs/ja.json b/app/appearance/langs/ja.jsonindex 5fda9ecde8..91c0745f92 100644--- a/app/appearance/langs/ja.json+++ b/app/appearance/langs/ja.json@@ -1,4 +1,5 @@{+ "displayImgAlt": "画像のツールチップのテキストを表示","displayImgName": "画像のファイル名を表示","s3EndpointBucketWarning": "Endpoint にバケット名が既に含まれている可能性があり、クラウドスナップショットの一覧取得やクリーンアップに支障が出る場合があります。設定を確認し、同期済みデータがある場合は、変更前にバックアップして保存先のパスを確認してください","embedHTMLFileBelow": "下に HTML ファイルを埋め込む",diff --git a/app/appearance/langs/ko.json b/app/appearance/langs/ko.jsonindex 1ef5693360..d116cbe832 100644--- a/app/appearance/langs/ko.json+++ b/app/appearance/langs/ko.json@@ -1,4 +1,5 @@{+ "displayImgAlt": "이미지 도움말 텍스트 표시","displayImgName": "이미지 파일 이름 표시","s3EndpointBucketWarning": "Endpoint에 버킷 이름이 이미 포함되어 있으면 클라우드 스냅샷 목록 조회와 정리에 문제가 생길 수 있습니다. 설정을 확인하고, 동기화된 데이터가 있다면 설정을 변경하기 전에 백업하고 저장 경로를 확인하세요","embedHTMLFileBelow": "아래에 HTML 파일 삽입",diff --git a/app/appearance/langs/nl.json b/app/appearance/langs/nl.jsonindex 3afd3f6c70..875c09ce41 100644--- a/app/appearance/langs/nl.json+++ b/app/appearance/langs/nl.json@@ -1,4 +1,5 @@{+ "displayImgAlt": "Tooltiptekst van afbeeldingen tonen","displayImgName": "Bestandsnamen van afbeeldingen tonen","s3EndpointBucketWarning": "Endpoint bevat mogelijk al de bucketnaam, wat het weergeven en opruimen van cloudsnapshots kan verstoren. Controleer de configuratie; maak een back-up van bestaande gesynchroniseerde gegevens en controleer hun opslagpad voordat u de configuratie wijzigt","embedHTMLFileBelow": "HTML-bestand hieronder insluiten",diff --git a/app/appearance/langs/pl.json b/app/appearance/langs/pl.jsonindex 63588f5ada..7e514a52f8 100644--- a/app/appearance/langs/pl.json+++ b/app/appearance/langs/pl.json@@ -1,4 +1,5 @@{+ "displayImgAlt": "Pokazuj tekst podpowiedzi obrazów","displayImgName": "Pokazuj nazwy plików obrazów","s3EndpointBucketWarning": "Endpoint może już zawierać nazwę zasobnika, co może zakłócać wyświetlanie i czyszczenie migawek w chmurze. Sprawdź konfigurację; jeśli istnieją już zsynchronizowane dane, wykonaj ich kopię zapasową i sprawdź ścieżkę przechowywania przed zmianą konfiguracji","embedHTMLFileBelow": "Osadź plik HTML poniżej",diff --git a/app/appearance/langs/pt-BR.json b/app/appearance/langs/pt-BR.jsonindex 7813c205cc..7b4a35b0ca 100644--- a/app/appearance/langs/pt-BR.json+++ b/app/appearance/langs/pt-BR.json@@ -1,4 +1,5 @@{+ "displayImgAlt": "Mostrar o texto de dica das imagens","displayImgName": "Mostrar nomes dos arquivos de imagem","s3EndpointBucketWarning": "Endpoint pode já conter o nome do bucket, o que pode prejudicar a listagem e a limpeza de snapshots na nuvem. Verifique a configuração; se já houver dados sincronizados, faça um backup e confirme o caminho de armazenamento antes de alterá-la","embedHTMLFileBelow": "Incorporar arquivo HTML abaixo",diff --git a/app/appearance/langs/ru.json b/app/appearance/langs/ru.jsonindex 1cffe1e000..e501f36e8e 100644--- a/app/appearance/langs/ru.json+++ b/app/appearance/langs/ru.json@@ -1,4 +1,5 @@{+ "displayImgAlt": "Показывать текст подсказок изображений","displayImgName": "Показывать имена файлов изображений","s3EndpointBucketWarning": "Endpoint может уже содержать имя бакета, что может нарушить получение списка и очистку облачных снимков. Проверьте настройки; если данные уже синхронизированы, создайте резервную копию и проверьте путь хранения перед изменением настроек","embedHTMLFileBelow": "Встроить HTML-файл ниже",diff --git a/app/appearance/langs/sk.json b/app/appearance/langs/sk.jsonindex cbb2456c2d..f220715c86 100644--- a/app/appearance/langs/sk.json+++ b/app/appearance/langs/sk.json@@ -1,4 +1,5 @@{+ "displayImgAlt": "Zobraziť text popisu obrázkov","displayImgName": "Zobraziť názvy súborov obrázkov","s3EndpointBucketWarning": "Endpoint už môže obsahovať názov bucketu, čo môže narušiť zobrazovanie a čistenie cloudových snímok. Skontrolujte nastavenia; ak už existujú synchronizované údaje, pred zmenou nastavení ich zálohujte a overte cestu uloženia","embedHTMLFileBelow": "Vložiť súbor HTML nižšie",diff --git a/app/appearance/langs/sr.json b/app/appearance/langs/sr.jsonindex e6f8ff8cf6..7505a424b3 100644--- a/app/appearance/langs/sr.json+++ b/app/appearance/langs/sr.json@@ -1,4 +1,5 @@{+ "displayImgAlt": "Прикажи текст објашњења слика","displayImgName": "Прикажи називе датотека слика","s3EndpointBucketWarning": "Endpoint можда већ садржи назив складишног контејнера, што може ометати приказ и чишћење снимака у облаку. Проверите подешавања; ако већ постоје синхронизовани подаци, направите резервну копију и проверите путању складиштења пре промене подешавања","embedHTMLFileBelow": "Угради HTML датотеку испод",diff --git a/app/appearance/langs/th.json b/app/appearance/langs/th.jsonindex d1a3591e81..47b4befb7e 100644--- a/app/appearance/langs/th.json+++ b/app/appearance/langs/th.json@@ -1,4 +1,5 @@{+ "displayImgAlt": "แสดงข้อความคำแนะนำรูปภาพ","displayImgName": "แสดงชื่อไฟล์รูปภาพ","s3EndpointBucketWarning": "Endpoint อาจมีชื่อบักเก็ตอยู่แล้ว ซึ่งอาจทำให้การแสดงรายการและล้างสแนปช็อตบนคลาวด์ผิดปกติ โปรดตรวจสอบการตั้งค่า หากมีข้อมูลที่ซิงค์แล้ว ให้สำรองข้อมูลและตรวจสอบเส้นทางจัดเก็บก่อนเปลี่ยนการตั้งค่า","embedHTMLFileBelow": "ฝังไฟล์ HTML ด้านล่าง",diff --git a/app/appearance/langs/tr.json b/app/appearance/langs/tr.jsonindex fdba6a789d..fc165ee07b 100644--- a/app/appearance/langs/tr.json+++ b/app/appearance/langs/tr.json@@ -1,4 +1,5 @@{+ "displayImgAlt": "Görsel ipucu metnini göster","displayImgName": "Görsel dosya adlarını göster","s3EndpointBucketWarning": "Endpoint zaten kova adını içeriyor olabilir; bu durum bulut anlık görüntülerinin listelenmesini ve temizlenmesini aksatabilir. Yapılandırmayı kontrol edin; eşitlenmiş veriler varsa yapılandırmayı değiştirmeden önce yedekleyin ve depolama yolunu doğrulayın","embedHTMLFileBelow": "HTML dosyasını aşağıya göm",diff --git a/app/appearance/langs/uk.json b/app/appearance/langs/uk.jsonindex e742c91fdc..3d55dc3fee 100644--- a/app/appearance/langs/uk.json+++ b/app/appearance/langs/uk.json@@ -1,4 +1,5 @@{+ "displayImgAlt": "Показувати текст підказок зображень","displayImgName": "Показувати назви файлів зображень","s3EndpointBucketWarning": "Endpoint може вже містити назву бакета, що може порушити отримання списку та очищення хмарних знімків. Перевірте налаштування; якщо дані вже синхронізовано, створіть резервну копію та перевірте шлях зберігання перед зміною налаштувань","embedHTMLFileBelow": "Вбудувати HTML-файл нижче",diff --git a/app/appearance/langs/zh-CN.json b/app/appearance/langs/zh-CN.jsonindex 457d1859ef..6f0f6a26e8 100644--- a/app/appearance/langs/zh-CN.json+++ b/app/appearance/langs/zh-CN.json@@ -1,4 +1,5 @@{+ "displayImgAlt": "显示图片提示文本","displayImgName": "显示图片文件名","s3EndpointBucketWarning": "Endpoint 可能重复包含桶名,导致云端快照列举和清理异常。请核对配置;已有同步数据时,请先备份并确认存储路径,再修改配置","embedHTMLFileBelow": "在下方嵌入 HTML 文件",diff --git a/app/appearance/langs/zh-TW.json b/app/appearance/langs/zh-TW.jsonindex 8031571960..b5d086187f 100644--- a/app/appearance/langs/zh-TW.json+++ b/app/appearance/langs/zh-TW.json@@ -1,4 +1,5 @@{+ "displayImgAlt": "顯示圖片提示文字","displayImgName": "顯示圖片檔名","s3EndpointBucketWarning": "Endpoint 可能重複包含儲存桶名稱,導致雲端快照列舉與清理異常。請核對設定;若已有同步資料,請先備份並確認儲存路徑,再修改設定","embedHTMLFileBelow": "在下方嵌入 HTML 檔案",diff --git a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100744-br924ar.sy b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100744-br924ar.syindex fd2023a002..027d30791c 100644--- a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100744-br924ar.sy+++ b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20200924100744-br924ar.sy@@ -6,7 +6,7 @@"id": "20200924100744-br924ar","title": "Assets","type": "doc",- "updated": "20260930092043"+ "updated": "20260930092955"},"Children": [{@@ -398,6 +398,47 @@}]},+ {+ "ID": "20260930092955-wsw0tvh",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20260930092955-wsw0tvh",+ "updated": "20260930092955"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "Enable "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "Settings"+ },+ {+ "Type": "NodeText",+ "Data": " - "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "Editor"+ },+ {+ "Type": "NodeText",+ "Data": " - "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "Show image tooltip text"+ },+ {+ "Type": "NodeText",+ "Data": " to display the image description below its title. Hovering over an image shows both its title and tooltip text even when this option is off. The description remains the image's existing alternative text and can be searched when inserting assets."+ }+ ]+ },{"ID": "20210115224203-q8bj2gd","Type": "NodeHeading",diff --git a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200915214115-42b8zma.sy b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200915214115-42b8zma.syindex 6e06978d74..004022d195 100644--- a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200915214115-42b8zma.sy+++ b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20200915214115-42b8zma.sy@@ -6,7 +6,7 @@"id": "20200915214115-42b8zma","title": "资源文件","type": "doc",- "updated": "20260930092043"+ "updated": "20260930092955"},"Children": [{@@ -398,6 +398,47 @@}]},+ {+ "ID": "20260930092955-skpw6hv",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20260930092955-skpw6hv",+ "updated": "20260930092955"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "开启 "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "设置"+ },+ {+ "Type": "NodeText",+ "Data": " - "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "编辑器"+ },+ {+ "Type": "NodeText",+ "Data": " - "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "显示图片提示文本"+ },+ {+ "Type": "NodeText",+ "Data": " 后,图片描述会显示在标题下方。即使关闭此选项,鼠标悬浮图片时也会同时显示标题和提示文本。描述仍使用图片原有的提示文本,插入资源时可以搜索。"+ }+ ]+ },{"ID": "20210115222011-bzsftun","Type": "NodeHeading",diff --git a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226123038-4umgpxy.sy b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226123038-4umgpxy.syindex 2a5efe4e12..e516b7d28a 100644--- a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226123038-4umgpxy.sy+++ b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20211226123038-4umgpxy.sy@@ -6,7 +6,7 @@"id": "20211226123038-4umgpxy","title": "資料文件","type": "doc",- "updated": "20260930092043"+ "updated": "20260930092955"},"Children": [{@@ -394,6 +394,47 @@}]},+ {+ "ID": "20260930092955-yhn9ixh",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20260930092955-yhn9ixh",+ "updated": "20260930092955"+ },+ "Children": [+ {+ "Type": "NodeText",+ "Data": "開啟 "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "設定"+ },+ {+ "Type": "NodeText",+ "Data": " - "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "編輯器"+ },+ {+ "Type": "NodeText",+ "Data": " - "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "顯示圖片提示文字"+ },+ {+ "Type": "NodeText",+ "Data": " 後,圖片描述會顯示在標題下方。即使關閉此選項,滑鼠懸停圖片時也會同時顯示標題和提示文字。描述仍使用圖片原有的提示文字,插入資源時可以搜尋。"+ }+ ]+ },{"ID": "20211226123051-5250xg7","Type": "NodeHeading",diff --git a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-1m5un7l.sy b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-1m5un7l.syindex 8e98b9312c..42afaddf07 100644--- a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-1m5un7l.sy+++ b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-1m5un7l.sy@@ -7,7 +7,7 @@"id": "20240530101000-1m5un7l","title": "アセット","type": "doc",- "updated": "20260930092043"+ "updated": "20260930092955"},"Children": [{@@ -401,6 +401,43 @@}]},+ {+ "ID": "20260930092955-e9bzngv",+ "Type": "NodeParagraph",+ "Properties": {+ "id": "20260930092955-e9bzngv",+ "updated": "20260930092955"+ },+ "Children": [+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "設定"+ },+ {+ "Type": "NodeText",+ "Data": " - "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "エディター"+ },+ {+ "Type": "NodeText",+ "Data": " - "+ },+ {+ "Type": "NodeTextMark",+ "TextMarkType": "kbd",+ "TextMarkTextContent": "画像のツールチップテキストを表示"+ },+ {+ "Type": "NodeText",+ "Data": " を有効にすると、画像の説明がタイトルの下に表示されます。この設定が無効でも、画像にマウスを合わせるとタイトルとツールチップテキストの両方が表示されます。説明には既存の代替テキストを使用し、アセットの挿入時に検索できます。"+ }+ ]+ },{"ID": "20240530101000-m2u22gy","Type": "NodeHeading",diff --git a/app/src/assets/scss/component/_typography.scss b/app/src/assets/scss/component/_typography.scssindex 57f0dc8991..a23fc4c419 100644--- a/app/src/assets/scss/component/_typography.scss+++ b/app/src/assets/scss/component/_typography.scss@@ -692,7 +692,8 @@}}- .protyle-action__title {+ .protyle-action__title,+ .img__alt {display: flex;font-size: 85%;color: var(--b3-theme-on-surface);diff --git a/app/src/assets/scss/protyle/_protyle.scss b/app/src/assets/scss/protyle/_protyle.scssindex 851249d220..03adaa95fd 100644--- a/app/src/assets/scss/protyle/_protyle.scss+++ b/app/src/assets/scss/protyle/_protyle.scss@@ -1430,7 +1430,8 @@ table + .protyle-action__table {}}-.img__name {+.img__name,+.img__alt {display: flex;align-items: center;justify-content: center;@@ -1445,6 +1446,7 @@ table + .protyle-action__table {input {min-width: 0;- width: 100%;+ flex: 1;+ width: 0;}}diff --git a/app/src/block/popover.test.ts b/app/src/block/popover.test.tsindex 67cc71aa2c..811ea224a4 100644--- a/app/src/block/popover.test.ts+++ b/app/src/block/popover.test.ts@@ -10,6 +10,7 @@ import {ScriptTarget, transpileModule} from "typescript";const browserCases = async (source: string) => {const check = require("node:assert/strict");const requests: ((response: unknown) => void)[] = [];+ let tooltip = "";class Panel {element = document.createElement("div");editors: {protyle: IProtyle}[] = [];@@ -36,6 +37,7 @@ const browserCases = async (source: string) => {BlockPanel: Panel,fetchSyncPost: () => new Promise(resolve => requests.push(resolve)),hideTooltip: () => {},+ showTooltip: (text: string) => { tooltip = text; },Constants: {TIMEOUT_INPUT: 5},isTouchDevice: () => false,isEncryptedBox: () => false,@@ -133,6 +135,24 @@ const browserCases = async (source: string) => {check.equal(window.siyuan.blockPanels.length, 1);check.equal(window.siyuan.config.editor.floatWindowMode, 0);check.equal(window.siyuan.config.editor.floatWindowDelay, 20);++ const imageRoot = document.createElement("span");+ imageRoot.className = "img";+ const image = document.createElement("img");+ image.title = "Caption %3Cem%3E & details";+ image.alt = "<literal> description";+ imageRoot.append(image);+ document.body.append(imageRoot);+ image.dispatchEvent(new MouseEvent("mouseover", {bubbles: true}));+ check.equal(tooltip, "Caption %3Cem%3E & details<br><literal> description");+ check.equal(image.title, "Caption %3Cem%3E & details");+ check.equal(image.alt, "<literal> description");+ image.title = "";+ image.dispatchEvent(new MouseEvent("mouseover", {bubbles: true}));+ check.equal(tooltip, "<literal> description");+ image.title = image.alt;+ image.dispatchEvent(new MouseEvent("mouseover", {bubbles: true}));+ check.equal(tooltip, "<literal> description");return "Popover interaction cases passed";};@@ -140,7 +160,7 @@ test("mindmap interaction cancels pending popovers and preserves hover preferencskip: process.platform === "linux" && !process.env.DISPLAY && !process.env.WAYLAND_DISPLAY,timeout: 20000,}, async () => {- const source = ["../protyle/util/hasClosest.ts", "popover.ts"].map(file => transpileModule(+ const source = ["../protyle/util/hasClosest.ts", "../util/escape.ts", "../protyle/render/imageTooltip.ts", "popover.ts"].map(file => transpileModule(readFileSync(path.join(__dirname, file), "utf8").replace(/^import [\s\S]*?;\r?\n/gm, "").replace(/^export /gm, ""),{compilerOptions: {target: ScriptTarget.ES2021}},).outputText).join("\n");diff --git a/app/src/block/popover.ts b/app/src/block/popover.tsindex f08a2b5493..279139d5ad 100644--- a/app/src/block/popover.ts+++ b/app/src/block/popover.ts@@ -14,6 +14,7 @@ import {import {isTouchDevice} from "../util/functions";import {escapeAriaLabel, escapeHtml, escapeLessThans} from "../util/escape";import {isListItemActionElement} from "../protyle/wysiwyg/listContext";+import {getImageTooltip} from "../protyle/render/imageTooltip";/// #if !MOBILEimport {getInstanceById} from "../layout/util";import {Editor} from "../editor";@@ -103,7 +104,8 @@ export const initBlockPopover = (app: App) => {hideTooltip();return;}- const aElement = (isListItemAction && listItemActionElement) ||+ const image = event.target instanceof HTMLImageElement && event.target.closest(".img") ? event.target : null;+ const aElement = image || (isListItemAction && listItemActionElement) ||hasClosestByAttribute(event.target, "data-type", "a", true) ||hasClosestByClassName(event.target, "ariaLabel") ||hasClosestByAttribute(event.target, "data-type", "tab-header") ||@@ -116,7 +118,7 @@ export const initBlockPopover = (app: App) => {let tooltipClass = "";let tooltipTarget = aElement as Element;let tooltipPositionOverride = isListItemAction ? "north" : undefined;- let tip = isListItemAction ? window.siyuan.languages.listItemActionTip :+ let tip = image ? getImageTooltip(image) : isListItemAction ? window.siyuan.languages.listItemActionTip :aElement.getAttribute("aria-label") || "";if (aElement.classList.contains("av__cell") && !aElement.classList.contains("ariaLabel")) {if (aElement.classList.contains("av__cell--header")) {@@ -184,7 +186,7 @@ export const initBlockPopover = (app: App) => {tooltipClass = "memo"; // 为行级备注添加 class https://github.com/siyuan-note/siyuan/issues/6161tooltipSpace = 0; // tooltip 和备注元素之间不能有空隙 https://github.com/siyuan-note/siyuan/issues/14796#issuecomment-3649757267}- if (!tip) {+ if (!tip && !image) {if (aElement.getAttribute("data-type")?.includes("a")) {tooltipClass = "href"; // 为超链接添加 class https://github.com/siyuan-note/siyuan/issues/11440#issuecomment-2119080691tooltipSpace = 0;@@ -285,8 +287,12 @@ export const initBlockPopover = (app: App) => {if (tip && !aElement.classList.contains("b3-tooltips")) {// https://github.com/siyuan-note/siyuan/issues/11294try {- showTooltip(decodeURIComponent(tip), tooltipTarget, tooltipClass, event, tooltipSpace,- tooltipPositionOverride);+ if (image) {+ showTooltip(tip, tooltipTarget, tooltipClass, event, tooltipSpace, tooltipPositionOverride);+ } else {+ showTooltip(decodeURIComponent(tip), tooltipTarget, tooltipClass, event, tooltipSpace,+ tooltipPositionOverride);+ }} catch (e) {// https://ld246.com/article/1718235737991showTooltip(tip, tooltipTarget, tooltipClass, event, tooltipSpace, tooltipPositionOverride);diff --git a/app/src/config/tabs/editorTab.ts b/app/src/config/tabs/editorTab.tsindex 54f3c65c5b..e6f5e5e5ea 100644--- a/app/src/config/tabs/editorTab.ts+++ b/app/src/config/tabs/editorTab.ts@@ -192,6 +192,9 @@ const registerEditorBlockFeaturesGroup = (tab: SettingTabBuilder) => {group.switch("editor.displayImgName", {title: window.siyuan.languages.displayImgName,});+ group.switch("editor.displayImgAlt", {+ title: window.siyuan.languages.displayImgAlt,+ });group.switch("editor.displayNetImgMark", {title: window.siyuan.languages.md7,desc: window.siyuan.languages.md8,diff --git a/app/src/protyle/render/imageDisplay.test.ts b/app/src/protyle/render/imageDisplay.test.tsindex fcb5522df8..6dccb70fd8 100644--- a/app/src/protyle/render/imageDisplay.test.ts+++ b/app/src/protyle/render/imageDisplay.test.ts@@ -11,7 +11,7 @@ const browserCases = async (source: string, luteSource: string) => {const check: typeof assert = require("node:assert/strict");new Function(luteSource)();const lute = Lute.New();- const config = {editor: {displayImgName: true}, readonly: false};+ const config = {editor: {displayImgName: true, displayImgAlt: true}, readonly: false};Object.assign(window, {siyuan: {config, languages: {rename: "Rename"}}});const renamed: {path: string, name: string}[] = [];const getExtension = (value: string) => require("node:path").posix.extname(value.split("?")[0]);@@ -37,6 +37,9 @@ const browserCases = async (source: string, luteSource: string) => {check.equal(root.querySelectorAll(".img__name").length, 1);const name = root.querySelector<HTMLElement>(".img__name");check.equal(name.textContent, "example.png");+ const alt = root.querySelector<HTMLElement>(".img__alt");+ check.equal(alt.textContent, "description");+ check.equal(alt.previousElementSibling.className, "protyle-action__title");check.equal(lute.BlockDOM2StdMd(root.innerHTML), original);name.click();let input = name.querySelector("input");@@ -60,8 +63,10 @@ const browserCases = async (source: string, luteSource: string) => {name.click();check.equal(name.querySelector("input"), null);config.editor.displayImgName = false;+ config.editor.displayImgAlt = false;render(root);check.equal(root.querySelector(".img__name"), null);+ check.equal(root.querySelector(".img__alt"), null);check.equal(lute.BlockDOM2StdMd(root.innerHTML), original);return "Image display cases passed";};diff --git a/app/src/protyle/render/imageDisplay.ts b/app/src/protyle/render/imageDisplay.tsindex 83dd58b7a0..a20d2505d9 100644--- a/app/src/protyle/render/imageDisplay.ts+++ b/app/src/protyle/render/imageDisplay.ts@@ -10,6 +10,20 @@ const setImageName = (element: HTMLElement, path: string) => {export const renderImageDisplay = (root: Element) => {root.querySelectorAll<HTMLImageElement>(".img img").forEach(image => {const container = image.parentElement;+ let alt = container.querySelector<HTMLElement>(".img__alt");+ if (window.siyuan.config.editor.displayImgAlt && image.alt) {+ if (!alt) {+ alt = document.createElement("span");+ alt.className = "img__alt";+ alt.contentEditable = "false";+ }+ const text = document.createElement("span");+ text.textContent = image.alt;+ alt.replaceChildren(text);+ container.append(alt);+ } else {+ alt?.remove();+ }let name = container.querySelector<HTMLElement>(".img__name");const path = image.getAttribute("data-src") || "";if (!window.siyuan.config.editor.displayImgName || !path.startsWith("assets/")) {diff --git a/app/src/protyle/render/imageTooltip.ts b/app/src/protyle/render/imageTooltip.tsnew file mode 100644index 0000000000..ff55bc8ac6--- /dev/null+++ b/app/src/protyle/render/imageTooltip.ts@@ -0,0 +1,5 @@+import {escapeHtml} from "../../util/escape";++export const getImageTooltip = (image: HTMLImageElement) => {+ return Array.from(new Set([image.title, image.alt].filter(Boolean))).map(text => escapeHtml(text)).join("<br>");+};diff --git a/app/src/types/api/index.d.ts b/app/src/types/api/index.d.tsindex 97b803e61f..4fc027a263 100644--- a/app/src/types/api/index.d.ts+++ b/app/src/types/api/index.d.ts@@ -1774,7 +1774,7 @@ export type SetCriterionRequestInput = { "criterion": CriterionInput | null; };export type SetDatabaseBlockViewRequestInput = { "avID": string; "id": string; "viewID": string; };-export type SetEditorRequestInput = { "allowHTMLBLockScript"?: boolean | null; "allowSVGScript"?: boolean | null; "assetOpen"?: SettingAssetOpenInput | null; "autoDirection"?: boolean | null; "backlinkBlockSort"?: number | null; "backlinkContainChildren"?: boolean | null; "backlinkExpandCount"?: number | null; "backlinkGlobalSort"?: number | null; "backlinkHideReference"?: boolean | null; "backlinkMentionExclude"?: string | null; "backlinkShowBottom"?: boolean | null; "backlinkSort"?: number | null; "backmentionExpandCount"?: number | null; "backmentionSort"?: number | null; "blockRefDynamicAnchorTextMaxLen"?: number | null; "checkBlockRef"?: boolean | null; "codeFontFamilies"?: Array<SettingEditorFontInput | null> | null; "codeLigatures"?: boolean | null; "codeLineWrap"?: boolean | null; "codeSyntaxHighlightLineNum"?: boolean | null; "codeTabSpaces"?: number | null; "cursorSurroundingLines"?: number | null; "databaseAttrClickMode"?: number | null; "databaseAttrHideEmpty"?: boolean | null; "databaseAttrShow"?: boolean | null; "databaseAttrUseTabs"?: boolean | null; "databaseAttrViewMode"?: number | null; "displayBookmarkIcon"?: boolean | null; "displayImgName"?: boolean | null; "displayNetImgMark"?: boolean | null; "dragHTMLFileToIframe"?: boolean | null; "dynamicLoadBlocks"?: number | null; "embedBlockBreadcrumb"?: boolean | null; "emoji"?: Array<string> | null; "floatWindowDelay"?: number | null; "floatWindowMode"?: number | null; "fontFamilies"?: Array<SettingEditorFontInput | null> | null; "fontFamily"?: string | null; "fontFamilyDisplay"?: string | null; "fontSize"?: number | null; "fontSizeScrollZoom"?: boolean | null; "fontWeight"?: number | null; "fullWidth"?: boolean | null; "generateHistoryInterval"?: number | null; "hashTagSearch"?: boolean | null; "headingEmbedMode"?: number | null; "headingNumber"?: boolean | null; "headingNumberFormat"?: string | null; "historyRetentionDays"?: number | null; "justify"?: boolean | null; "katexMacros"?: string | null; "keepLoadedContent"?: boolean | null; "listItemDotNumberClickFocus"?: boolean | null; "listLogicalOutdent"?: boolean | null; "markdown"?: SettingMarkdownInput | null; "onlySearchForDoc"?: boolean | null; "pasteURLAutoConvert"?: boolean | null; "plantUMLServePath"?: string | null; "readOnly"?: boolean | null; "rtl"?: boolean | null; "spellcheck"?: boolean | null; "spellcheckLanguages"?: Array<string> | null; "virtualBlockRef"?: boolean | null; "virtualBlockRefExclude"?: string | null; "virtualBlockRefInclude"?: string | null; };+export type SetEditorRequestInput = { "allowHTMLBLockScript"?: boolean | null; "allowSVGScript"?: boolean | null; "assetOpen"?: SettingAssetOpenInput | null; "autoDirection"?: boolean | null; "backlinkBlockSort"?: number | null; "backlinkContainChildren"?: boolean | null; "backlinkExpandCount"?: number | null; "backlinkGlobalSort"?: number | null; "backlinkHideReference"?: boolean | null; "backlinkMentionExclude"?: string | null; "backlinkShowBottom"?: boolean | null; "backlinkSort"?: number | null; "backmentionExpandCount"?: number | null; "backmentionSort"?: number | null; "blockRefDynamicAnchorTextMaxLen"?: number | null; "checkBlockRef"?: boolean | null; "codeFontFamilies"?: Array<SettingEditorFontInput | null> | null; "codeLigatures"?: boolean | null; "codeLineWrap"?: boolean | null; "codeSyntaxHighlightLineNum"?: boolean | null; "codeTabSpaces"?: number | null; "cursorSurroundingLines"?: number | null; "databaseAttrClickMode"?: number | null; "databaseAttrHideEmpty"?: boolean | null; "databaseAttrShow"?: boolean | null; "databaseAttrUseTabs"?: boolean | null; "databaseAttrViewMode"?: number | null; "displayBookmarkIcon"?: boolean | null; "displayImgAlt"?: boolean | null; "displayImgName"?: boolean | null; "displayNetImgMark"?: boolean | null; "dragHTMLFileToIframe"?: boolean | null; "dynamicLoadBlocks"?: number | null; "embedBlockBreadcrumb"?: boolean | null; "emoji"?: Array<string> | null; "floatWindowDelay"?: number | null; "floatWindowMode"?: number | null; "fontFamilies"?: Array<SettingEditorFontInput | null> | null; "fontFamily"?: string | null; "fontFamilyDisplay"?: string | null; "fontSize"?: number | null; "fontSizeScrollZoom"?: boolean | null; "fontWeight"?: number | null; "fullWidth"?: boolean | null; "generateHistoryInterval"?: number | null; "hashTagSearch"?: boolean | null; "headingEmbedMode"?: number | null; "headingNumber"?: boolean | null; "headingNumberFormat"?: string | null; "historyRetentionDays"?: number | null; "justify"?: boolean | null; "katexMacros"?: string | null; "keepLoadedContent"?: boolean | null; "listItemDotNumberClickFocus"?: boolean | null; "listLogicalOutdent"?: boolean | null; "markdown"?: SettingMarkdownInput | null; "onlySearchForDoc"?: boolean | null; "pasteURLAutoConvert"?: boolean | null; "plantUMLServePath"?: string | null; "readOnly"?: boolean | null; "rtl"?: boolean | null; "spellcheck"?: boolean | null; "spellcheckLanguages"?: Array<string> | null; "virtualBlockRef"?: boolean | null; "virtualBlockRefExclude"?: string | null; "virtualBlockRefInclude"?: string | null; };export type SetEntryVisibilityRequestInput = { "active"?: string | null; "profiles"?: Array<SettingEntryVisibilityProfileInput | null> | null; "version"?: number | null; };@@ -1900,7 +1900,7 @@ export type SettingEditing = { "maxCompletionTokens": number; "maxHistoryMessageexport type SettingEditingInput = { "maxCompletionTokens"?: number | null; "maxHistoryMessages"?: number | null; "modelId"?: string | null; "temperature"?: number | null; };-export type SettingEditor = { "allowHTMLBLockScript": boolean; "allowSVGScript": boolean; "assetOpen": SettingAssetOpen | null; "autoDirection": boolean; "backlinkBlockSort": number; "backlinkContainChildren": boolean; "backlinkExpandCount": number; "backlinkGlobalSort": number; "backlinkHideReference": boolean; "backlinkMentionExclude": string; "backlinkShowBottom": boolean; "backlinkSort": number | null; "backmentionExpandCount": number; "backmentionSort": number | null; "blockRefDynamicAnchorTextMaxLen": number; "checkBlockRef": boolean | null; "codeFontFamilies": Array<SettingEditorFont | null> | null; "codeLigatures": boolean; "codeLineWrap": boolean; "codeSyntaxHighlightLineNum": boolean; "codeTabSpaces": number; "cursorSurroundingLines": number; "databaseAttrClickMode": number; "databaseAttrHideEmpty": boolean; "databaseAttrShow": boolean | null; "databaseAttrUseTabs": boolean | null; "databaseAttrViewMode": number; "displayBookmarkIcon": boolean; "displayImgName": boolean; "displayNetImgMark": boolean; "dragHTMLFileToIframe": boolean; "dynamicLoadBlocks": number; "embedBlockBreadcrumb": boolean; "emoji": Array<string> | null; "floatWindowDelay": number | null; "floatWindowMode": number; "fontFamilies": Array<SettingEditorFont | null> | null; "fontFamily": string; "fontFamilyDisplay": string; "fontSize": number; "fontSizeScrollZoom": boolean; "fontWeight": number; "fullWidth": boolean; "generateHistoryInterval": number; "hashTagSearch": boolean | null; "headingEmbedMode": number; "headingNumber": boolean; "headingNumberFormat": string; "historyRetentionDays": number; "justify": boolean; "katexMacros": string; "keepLoadedContent": boolean; "listItemDotNumberClickFocus": boolean; "listLogicalOutdent": boolean; "markdown": SettingMarkdown | null; "onlySearchForDoc": boolean; "pasteURLAutoConvert": boolean; "plantUMLServePath": string; "readOnly": boolean; "rtl": boolean; "spellcheck": boolean; "spellcheckLanguages": Array<string> | null; "virtualBlockRef": boolean; "virtualBlockRefExclude": string; "virtualBlockRefInclude": string; };+export type SettingEditor = { "allowHTMLBLockScript": boolean; "allowSVGScript": boolean; "assetOpen": SettingAssetOpen | null; "autoDirection": boolean; "backlinkBlockSort": number; "backlinkContainChildren": boolean; "backlinkExpandCount": number; "backlinkGlobalSort": number; "backlinkHideReference": boolean; "backlinkMentionExclude": string; "backlinkShowBottom": boolean; "backlinkSort": number | null; "backmentionExpandCount": number; "backmentionSort": number | null; "blockRefDynamicAnchorTextMaxLen": number; "checkBlockRef": boolean | null; "codeFontFamilies": Array<SettingEditorFont | null> | null; "codeLigatures": boolean; "codeLineWrap": boolean; "codeSyntaxHighlightLineNum": boolean; "codeTabSpaces": number; "cursorSurroundingLines": number; "databaseAttrClickMode": number; "databaseAttrHideEmpty": boolean; "databaseAttrShow": boolean | null; "databaseAttrUseTabs": boolean | null; "databaseAttrViewMode": number; "displayBookmarkIcon": boolean; "displayImgAlt": boolean; "displayImgName": boolean; "displayNetImgMark": boolean; "dragHTMLFileToIframe": boolean; "dynamicLoadBlocks": number; "embedBlockBreadcrumb": boolean; "emoji": Array<string> | null; "floatWindowDelay": number | null; "floatWindowMode": number; "fontFamilies": Array<SettingEditorFont | null> | null; "fontFamily": string; "fontFamilyDisplay": string; "fontSize": number; "fontSizeScrollZoom": boolean; "fontWeight": number; "fullWidth": boolean; "generateHistoryInterval": number; "hashTagSearch": boolean | null; "headingEmbedMode": number; "headingNumber": boolean; "headingNumberFormat": string; "historyRetentionDays": number; "justify": boolean; "katexMacros": string; "keepLoadedContent": boolean; "listItemDotNumberClickFocus": boolean; "listLogicalOutdent": boolean; "markdown": SettingMarkdown | null; "onlySearchForDoc": boolean; "pasteURLAutoConvert": boolean; "plantUMLServePath": string; "readOnly": boolean; "rtl": boolean; "spellcheck": boolean; "spellcheckLanguages": Array<string> | null; "virtualBlockRef": boolean; "virtualBlockRefExclude": string; "virtualBlockRefInclude": string; };export type SettingEditorFont = { "displayName": string; "family": string; "weight": number; };diff --git a/app/src/types/config.d.ts b/app/src/types/config.d.tsindex 3dd5fdbf8a..1547da8b8a 100644--- a/app/src/types/config.d.ts+++ b/app/src/types/config.d.ts@@ -619,6 +619,8 @@ declare namespace Config {displayNetImgMark: boolean;/** 全局显示图片文件名,默认关闭,不写入文档属性 */displayImgName: boolean;+ /** 全局在图片标题下显示提示文本,默认关闭,不写入文档属性 */+ displayImgAlt: boolean;/*** Whether to show database attributes at the top of the document*/diff --git a/kernel/api/contract_setting_test.go b/kernel/api/contract_setting_test.goindex 8e55c7b48b..5384ecfb1e 100644--- a/kernel/api/contract_setting_test.go+++ b/kernel/api/contract_setting_test.go@@ -97,6 +97,8 @@ func TestAPIContractSettingImageDisplayCompatibility(t *testing.T) {compareSettingConfig(t, apicontract.SetEditor, conf.NewEditor, []string{`{}`, `{"displayImgName":true}`, `{"displayImgName":false}`,`{"displayImgName":null}`, `{"DisplayImgName":true}`, `{"displayImgName":"bad"}`,+ `{"displayImgAlt":true}`, `{"displayImgAlt":false}`, `{"displayImgAlt":null}`,+ `{"DisplayImgAlt":true}`, `{"displayImgAlt":"bad"}`,})}@@ -127,6 +129,22 @@ func TestAPIContractSettingImageDisplayUpdates(t *testing.T) {t.Fatalf("image display update %s: code=%d message=%s data=%s", entry.body, code, message, data)}}+ for _, entry := range []struct {+ body string+ want bool+ }{+ {`{"displayImgAlt":true}`, true}, {`{}`, true}, {`{"displayImgAlt":false}`, false},+ {`{"DisplayImgAlt":true}`, true}, {`{"displayImgAlt":null}`, false},+ } {+ code, message, data := settingContractRequest(t, "setEditor", setEditor, entry.body)+ var response apicontract.SettingEditor+ if err := json.Unmarshal(data, &response); err != nil {+ t.Fatal(err)+ }+ if code != 0 || model.Conf.Editor.DisplayImgAlt != entry.want || response.DisplayImgAlt != entry.want {+ t.Fatalf("image tooltip text update %s: code=%d message=%s data=%s", entry.body, code, message, data)+ }+ }}func TestAPIContractSettingParserCompatibility(t *testing.T) {diff --git a/kernel/api/setting.go b/kernel/api/setting.goindex 4151524325..6f7735eced 100644--- a/kernel/api/setting.go+++ b/kernel/api/setting.go@@ -378,6 +378,9 @@ var setEditor = contractHandler(apicontract.SetEditor, func(c *gin.Context, requif !request.HasFieldFold("displayImgName") {editor.DisplayImgName = model.Conf.Editor.DisplayImgName}+ if !request.HasFieldFold("displayImgAlt") {+ editor.DisplayImgAlt = model.Conf.Editor.DisplayImgAlt+ }editor.NormalizeFontFamilies()if "" == editor.PlantUMLServePath {diff --git a/kernel/api/setting_contract.go b/kernel/api/setting_contract.goindex 06c0edf705..a01ad87b25 100644--- a/kernel/api/setting_contract.go+++ b/kernel/api/setting_contract.go@@ -348,6 +348,7 @@ func settingEditorPayload(value *conf.Editor) *apicontract.SettingEditor {result.DisplayBookmarkIcon = value.DisplayBookmarkIconresult.DisplayNetImgMark = value.DisplayNetImgMarkresult.DisplayImgName = value.DisplayImgName+ result.DisplayImgAlt = value.DisplayImgAltresult.DatabaseAttrShow = value.DatabaseAttrShowresult.DatabaseAttrClickMode = value.DatabaseAttrClickModeresult.DatabaseAttrViewMode = value.DatabaseAttrViewModediff --git a/kernel/apicontract/schema.json b/kernel/apicontract/schema.jsonindex 6ed0488e85..2ac52e9f33 100644--- a/kernel/apicontract/schema.json+++ b/kernel/apicontract/schema.json@@ -38546,6 +38546,16 @@}]},+ "displayImgAlt": {+ "anyOf": [+ {+ "type": "boolean"+ },+ {+ "type": "null"+ }+ ]+ },"displayImgName": {"anyOf": [{@@ -42030,6 +42040,9 @@"displayBookmarkIcon": {"type": "boolean"},+ "displayImgAlt": {+ "type": "boolean"+ },"displayImgName": {"type": "boolean"},@@ -42229,6 +42242,7 @@"databaseAttrUseTabs","databaseAttrViewMode","displayBookmarkIcon",+ "displayImgAlt","displayImgName","displayNetImgMark","dragHTMLFileToIframe",diff --git a/kernel/apicontract/setting.go b/kernel/apicontract/setting.goindex 46c07a9dc4..c180267f85 100644--- a/kernel/apicontract/setting.go+++ b/kernel/apicontract/setting.go@@ -174,7 +174,7 @@ type SettingFlashcard struct {Weights string `json:"weights" api:"optional,nullable"`}-// SettingEditor 描述编辑器配置。displayImgName 默认关闭,更新设置时省略该字段保留当前值。+// SettingEditor 描述编辑器配置。displayImgName 和 displayImgAlt 默认关闭,更新设置时省略这些字段保留当前值。type SettingEditor struct {AllowSVGScript bool `json:"allowSVGScript" api:"optional,nullable"`AllowHTMLBLockScript bool `json:"allowHTMLBLockScript" api:"optional,nullable"`@@ -193,6 +193,7 @@ type SettingEditor struct {DisplayBookmarkIcon bool `json:"displayBookmarkIcon" api:"optional,nullable"`DisplayNetImgMark bool `json:"displayNetImgMark" api:"optional,nullable"`DisplayImgName bool `json:"displayImgName" api:"optional,nullable"`+ DisplayImgAlt bool `json:"displayImgAlt" api:"optional,nullable"`DatabaseAttrShow *bool `json:"databaseAttrShow" api:"optional,nullable"`DatabaseAttrClickMode int `json:"databaseAttrClickMode" api:"optional,nullable"`DatabaseAttrViewMode int `json:"databaseAttrViewMode" api:"optional,nullable"`diff --git a/kernel/conf/editor.go b/kernel/conf/editor.goindex 49397e31a1..bdd9568e8d 100644--- a/kernel/conf/editor.go+++ b/kernel/conf/editor.go@@ -61,6 +61,7 @@ type Editor struct {DisplayBookmarkIcon bool `json:"displayBookmarkIcon"` // 是否显示内容块角标DisplayNetImgMark bool `json:"displayNetImgMark"` // 是否显示网络图片角标DisplayImgName bool `json:"displayImgName"` // 是否显示图片文件名+ DisplayImgAlt bool `json:"displayImgAlt"` // 是否显示图片提示文本DatabaseAttrShow *bool `json:"databaseAttrShow"` // 是否在文档顶部显示数据库属性DatabaseAttrClickMode int `json:"databaseAttrClickMode"` // 数据库角标点击模式,0:聚焦块并展开数据库面板,1:打开块属性面板DatabaseAttrViewMode int `json:"databaseAttrViewMode"` // 数据库属性默认展开状态,0:展开,1:折叠