Skip to content

fix(content): content hidden or broken by unclosed language blocks - #380

Open
AdingApkgg wants to merge 1 commit into
OpenListTeam:mainfrom
AdingApkgg:fix/content-fixes
Open

AdingApkgg wants to merge 1 commit into
OpenListTeam:mainfrom
AdingApkgg:fix/content-fixes

Conversation

@AdingApkgg

Copy link
Copy Markdown

Description / 描述

修复现网文档中因语言块(::: en / ::: zh-CN)或内层容器没有在正确位置闭合,导致部分内容在某种语言下看不到、或 ::: 被直接显示成文字的问题。只改内容,不涉及框架,基于当前的 Valaxy 写法。

markdown-it-container 会在遇到的第一个 ::: 处结束容器,所以一旦某个块少写或多写了结束标记,后面的内容就会被嵌进另一种语言的块里,这种语言的读者就看不到它。

某种语言下看不到的内容

  • ecosystem:英文页看不到 jiwangyihao/olist-cdn-preheat 这一条(HisAtri 的中文块没有闭合);另有一个多余的 :::: 被显示成文字。
  • drivers/115:中文页看不到「使用 Python 脚本获取 Cookie」前面的 Python 版本要求和扫码步骤。
  • drivers/115_open:英文页看不到「4. Notes」一节。
  • drivers/189:中文页看不到开头的提示。
  • drivers/thunder:英文页看不到「3. Thunder X」章节标题,迅雷 X 的内容被挂在了第 2 节下面。
  • installation/reverse-proxy:中文页看不到宝塔教程第 1 步(::: 误写成了 ::);::: note 不是可用的容器,被显示成文字,改为 ::: tip。

::: 显示成文字、中英文内容串到一起

  • installation/desktop、installation/worker、ecosystem/official_worker/guide、seeds/design:外层和内层容器都用了 :::,或者结束标记被 Prettier 合并进了引用块,导致 ::: 显示成文字,部分英文常见问题出现在中文页(反之亦然)。外层改用 ::::,引用块后的结束标记单独成行。

其他

  • advanced/mcp:{{ lang="en" }} 不是属性语法,标题后面多显示了「en」「zh-CN」,而且中英文标题同时出现。改为 { lang="en" }。
  • ecosystem/official_worker:页面 URL 结尾没有 /,所以 ./guide 等相对链接被解析成 /ecosystem/guide,打开是 404。改为绝对链接;「设计架构」「常见问题」原来指向不存在的 ./architecture、./faq,改为现有的 basic、about 页面。

Motivation and Context / 背景

这些问题都在现网上存在,与 #377 的 VitePress 迁移无关,可以单独合并。#377 中已经包含了同样的修复(按新目录结构),这个 PR 先把它们带到现在的站点上。

测试

  • valaxy build --ssg 成功,151 个页面全部生成。
  • 用与 Valaxy 相同的 markdown-it + markdown-it-container 解析全部页面:不再有某种语言的块嵌在另一种语言的块里,也不再有 ::: 被当成文字。
  • 检查生成的 HTML:上面每处修复的内容都落在了正确的 <div lang="..."> 里(例如 115 的中文说明只在 zh-CN 块中,olist-cdn-preheat 的标题不再位于中文块内)。
  • prettier --check 通过。

Checklist / 检查清单

  • I have read the CONTRIBUTING document.
    我已阅读 CONTRIBUTING 文档。
  • I have formatted my code or documentation with prettier or other appropriate formatter.
    我已使用 prettier 或其他适当的格式化工具格式化提交的代码或文档。
  • I have updated all supported languages (including Chinese and English) for documentation. (If it's needed)
    我已为所有支持语言(包括中文和英文)更新文档内容。 (若适用)
  • I have verified that the written documentation or code is properly formatted, with no syntax errors, spelling mistakes.
    我已确认编写的文档或代码格式正确, 无语法错误, 拼写错误。
  • I have updated the repository accordingly (If it's needed).
    我已相应更新了相关仓库(若适用)。(不适用)

🤖 Generated with Claude Code

Several pages had a `::: en` / `::: zh-CN` block (or an inner `::: tip`
etc.) closed at the wrong place. markdown-it-container closes a block at
the first `:::` it finds, so the next block ended up nested in the
wrong language and was hidden from the readers of the other one, or a
leftover `:::` was shown as text:

- ecosystem: the olist-cdn-preheat entry was hidden in English; a stray
  `::::` was shown as text
- drivers/115: Python requirements and QR code steps hidden in Chinese
- drivers/115_open: the "4. Notes" section hidden in English
- drivers/189: the tip hidden in Chinese
- drivers/thunder: the "3. Thunder X" heading hidden in English
- installation/reverse-proxy: step 1 of the aaPanel tutorial hidden in
  Chinese (`::` typo); `::: note` is not a container, use `::: tip`
- installation/desktop, installation/worker, ecosystem/official_worker/
  guide, seeds/design: `:::` shown as text, and English troubleshooting
  items shown on the Chinese page (and vice versa)

Also:

- advanced/mcp: `{{ lang="..." }}` is not attribute syntax, the headings
  showed "en" / "zh-CN" in both languages
- ecosystem/official_worker: the page URL has no trailing slash, so
  `./guide` etc. resolved to /ecosystem/guide (404); use absolute links,
  and point "architecture" / "faq" at the existing basic / about pages

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant