mdutils

package
v1.1.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TruncateMarkdown

func TruncateMarkdown(content string, maxBytes int) (string, bool)

TruncateMarkdown 将 Markdown 内容截断到 maxBytes 字节以内,在块级 AST 节点边界处截断以保持语法结构完整。 仅执行截断,不追加任何后缀;maxBytes 全部用于内容预算。 返回值第二个 bool 表示是否发生了截断;未截断时原样返回内容。

func TruncateMarkdownWithSuffix

func TruncateMarkdownWithSuffix(content string, maxBytes int, suffix string) (string, bool)

TruncateMarkdownWithSuffix 在 TruncateMarkdown 基础上追加省略后缀。 suffix 为空时使用默认后缀 ...;后缀字节长度计入 maxBytes 总预算。

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL