[Feature Request] docs 域支持文档内锚点跳转(docsLink / 同文档内部链接)
Open
Nobody has claimed this yet.
domain/doc
enhancement
- Dominant language
- Go
- Stars
- 17.3k
- Forks
- 1.4k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 105
Description
问题描述
当前通过 docs +update 写入 <a href="https://xxx.feishu.cn/docx/xxxxx#block_id"> 形式的超链接后,点击链接会新开标签页打开文档,无法在当前文档页面内滚动跳转到目标 block。
期望能力
希望支持以下任一方式实现同文档内跳转:
- 在 XML 中支持
docsLink类型的行内元素(对应飞书开放平台 ParagraphElement.docsLink),写入同文档 URL 时前端识别为文档内引用并滚动跳转; - 支持相对锚点链接,如
<a href="#block_id">或<a href="#share-xxx">,不强制写完整域名; - 或提供获取 block
share token/lineId的能力(当前lineId仅返回不支持写入)。
使用场景
- 长文档目录导航
- 章节间交叉引用
- 术语表 / 附录回链
相关参考
- 飞书文档数据结构:ParagraphElement.docsLink、TextRun.lineId
- 当前版本:lark-cli v1.0.86
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the docs +update entry point and how XML inline links are converted before being written. Read the referenced ParagraphElement.docsLink and TextRun.lineId structures, then determine which supported approach fits; done means same-document links scroll to the target block without opening a new tab, with the chosen behavior covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 42/100