tiddly-gittly / TidGi-Desktop

TidGi is an privacy-in-mind, automated, auto-git-backup, freely-deployed knowledge management Desktop note app, based on Tiddlywiki, with REST API for web-clipping and Anki connect. 「 太记 」是一个基于「 太微 TiddlyWiki 」的知识管理桌面应用,能保护隐私内容、高级自动化、自动Git云备份、部署为博客,且可通过RESTAPI与Anki等应用连接。(迭代开发中欢迎试用,开发进度见下方链接)(Under active development, see website below for details)
https://tidgi.fun
Mozilla Public License 2.0
1.74k stars 111 forks source link

bug: 太记编辑代码块时报错 #573

Closed LittFlower closed 4 months ago

LittFlower commented 4 months ago

Environment 环境信息

TidGi (linux)
Version v0.10.2

Electron Version: 31.1.0
Node Version: 20.14.0
Chromium Version: 126.0.6478.114

Description 描述

当我在创建一个条目后,编辑它,输入 “```” 这样的字符串试图开一个代码块时,报错如下:

内部的 JavaScript 错误
喔,真是令人尴尬。建议刷新您的浏览器,重新启动 TiddlyWiki
download tiddlers as json
Uncaught Error: Cannot get the leaf node at path [0,0] because it refers to a non-leaf node: {"type":"code_line","children":[{"text":""}],"id":"aaaa-1"}

image

可以注意到我的代码块是创建成功了的,但是会报错。并且我关闭弹窗后,在代码块输入字符后,仍然会报类似的错误弹窗。我在本仓库的 issue 和 google 中暂时没有找到类似的问题和解决方案。

报错给了一个 json,我已一并上传。 emergency-tiddlers-Sat Jul 06 2024 13_32_03 GMT+0800 (中国标准时间).json

Steps to Reproduce 复现方式

如我在描述中所写,步骤如下:

Additional Context 额外上下文

系统环境如下:

                  -`                     flower@ArchLinux
                 .o+`                    ----------------
                `ooo/                    OS: Arch Linux x86_64
               `+oooo:                   Host: ASUS TUF Gaming F15 FX507VV_FX507VV (1.0)
              `+oooooo:                  Kernel: Linux 6.9.5-arch1-1.1-g14
              -+oooooo+:                 Uptime: 4 hours, 9 mins
            `/:-:++oooo+:                Packages: 1967 (pacman)
           `/++++/+++++++:               Shell: zsh 5.9
          `/++++++++++++++:              Display (NE156FHM-NX6): 1920x1080 @ 144Hz [Built-in]
         `/+++ooooooooooooo/`            DE: KDE Plasma 6.1.2
        ./ooosssso++osssssso+`           WM: KWin (Wayland)
       .oossssso-````/ossssss+`          WM Theme: Klassy
      -osssssso.      :ssssssso.         Theme: Klassy (Dark) [Qt], Breeze-Dark [GTK2], Breeze [GTK3/4]
     :osssssss/        osssso+++.        Icons: Fluent-dark [Qt], Fluent-dark [GTK2/3/4]
    /ossssssss/        +ssssooo/-        Font: 终端更纱黑体-简 Nerd (14pt) [Qt], 终端更纱黑体-简 Nerd (14pt) [GTK2/3/4]
  `/ossssso+/:-        -:/+osssso+-      Cursor: Bibata-Modern-Ice (28px)
 `+sso+:-`                 `.-/+oso:     Terminal: konsole 24.5.2
`++:.                           `-/+/    Terminal Font: 终端更纱黑体-简 Nerd (15pt, Semibold)
.`                                 `/    CPU: 13th Gen Intel(R) Core(TM) i7-13700H (20) @ 5.00 GHz
                                         GPU 1: Intel Iris Xe Graphics @ 1.50 GHz [Integrated]
                                         GPU 2: NVIDIA GeForce RTX 4060 Max-Q / Mobile [Discrete]
                                         Memory: 6.05 GiB / 15.25 GiB (40%)
                                         Swap: 382.50 MiB / 8.00 GiB (5%)
                                         Disk (/): 766.00 GiB / 1006.85 GiB (76%) - ext4
                                         Disk (/home): 374.23 GiB / 859.92 GiB (44%) - ext4
                                         Local IP (wlo1): 10.134.131.195/21 *
                                         Battery: 80% [AC Connected]
                                         Locale: zh_CN.UTF-8

软件包链接.

linonetwo commented 4 months ago

所见即所得编辑器暂不支持代码块和图片,你点带 T✏️ 的图标关闭所见即所得编辑器即可。然后用✏️普通编辑模式编辑吧。

linonetwo commented 4 months ago

代码在 https://github.com/tiddly-gittly/slate-write ,最近没人写它,因为懂编译原理的人太少了

LittFlower commented 4 months ago

所见即所得编辑器暂不支持代码块和图片,你点带 T✏️ 的图标关闭所见即所得编辑器即可。然后用✏️普通编辑模式编辑吧。

好的,普通编辑模式正常。