package
Version:
v1.1.16
Opens a new window with list of versions in this module.
Published: Jul 23, 2026
License: Apache-2.0
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
TruncateMarkdown 将 Markdown 内容截断到 maxBytes 字节以内,在块级 AST 节点边界处截断以保持语法结构完整。
仅执行截断,不追加任何后缀;maxBytes 全部用于内容预算。
返回值第二个 bool 表示是否发生了截断;未截断时原样返回内容。
TruncateMarkdownWithSuffix 在 TruncateMarkdown 基础上追加省略后缀。
suffix 为空时使用默认后缀 ...;后缀字节长度计入 maxBytes 总预算。
Source Files
¶
Click to show internal directories.
Click to hide internal directories.