Repository navigation
v1.3.1 — 目录章节可跳(同笔记锚点)+ 长笔记不再被截断
v1.3.1 — 目录里的章节真的能跳了
用户报的是「我点目录里的章节不能跳转过去」。查下去发现两层问题叠在一起,只修一层会被误判成"改坏了"。
第一层:链接形式
合订本目录写的是 Obsidian 的同笔记标题链接 —— 45 个 [[#第 N 节 …\|N. 短标题]](表格里别名管道转义成 \|)。面板把所有 [[…]] 一律送进 /resolve-link 当笔记名解析,于是每个章节都是死按钮;同一类的 [x](#锚点) 被渲染成 target="_blank" 的 <a>,点了开空白页。
第二层:标题根本不在页面上
宿主 MAX_NOTE_BYTES = 512 KB 只读了 2.42 MB 文件的约 21%(≈2,400 行,到第 6 节),客户端 MAX_RENDER_LINES = 3,000 再切一刀 → 45 个目标里 39 个从未被画出来。解析修好了也跳不过去。
改了什么
[[#标题]]/[[#标题|别名]]/[x](#锚点)就地滚动,先剥掉\|的转义反斜杠;[[笔记#标题]]只取笔记名去打开(以前把标题当笔记名,库里 9 处全废)- 跳转读的是已渲染标题的文本与
id,不把笔记再解析一遍(与大纲同一套纪律);先按 Obsidian 的标题文本精确匹配,再退回 GitHub 式 slug - 上限:宿主 512 KB → 4 MB,客户端 3,000 → 40,000 行
- 依据是实测而非手感:整篇 11,738 行 / 2.42 MB → 解析 48 ms + 渲染 84 ms、2.33 MB HTML、8,509 个元素
可验证
- 把 45 个目录格子逐个「点击」 → 45/45 命中已渲染标题(整篇 892 个标题)
render-check新增 12 项:三种锚点写法、转义管道、外链仍是链接、无导航器时降级为虚线 span、slug、4,000 行笔记能画到最后一个小标题host-check新增:超过旧 512 KB 的笔记整篇读取(truncated:false、1,184,494 字符)- 仓库 render / mount / host(104) / manifest(24) / platform(30) 全绿
升级提醒
宿主半的改动需要重启 DSH 才装载,只刷新页面不够 —— 否则笔记仍按旧 512 KB 读,第 7 节以后照旧「找不到标题」。
English
v1.3.1 makes same-note heading links jump. The compiled guide's table of contents is 45 cells of [[#第 N 节 …\|N. 短标题]] — an alias pipe escaped so the table parser keeps the row — and every one was sent to the note resolver as if the heading were a note name, so all 45 were dead buttons; [x](#锚点) links opened a blank tab. They now scroll in place: the jump reads the rendered headings' text and ids instead of parsing the note again, tries Obsidian's exact heading text first and a GitHub-style slug as the fallback, and says so when a heading really is absent.
It also would not have worked past chapter 6. The host read cap (512 KB) and the render cap (3,000 lines) meant 39 of the 45 targets had never been drawn. Both now sit above this note — 4 MB read, 40,000 lines — which the measurements support: the whole 11,738-line guide parses in 48 ms, renders in 84 ms, and becomes 2.3 MB of HTML / 8,509 elements. Verified by clicking all 45 entries in the real note (45/45 resolve to a rendered heading), plus new render-check assertions (three anchor spellings, the escaped pipe, external links staying links, the no-navigator fallback, the slug, and a 4,000-line note reaching its last heading) and a host-check assertion that a note over the old 512 KB cap is read whole. Restart DSH for the host half.