MCPcopy Create free account
hub / github.com/astercloud/aster / extractTitle

Function extractTitle

pkg/memory/rules/manager.go:202–211  ·  view source on GitHub ↗

extractTitle 从 Markdown 中提取标题

(content string)

Source from the content-addressed store, hash-verified

200
201// extractTitle 从 Markdown 中提取标题
202func extractTitle(content string) string {
203 lines := strings.SplitSeq(content, "\n")
204 for line := range lines {
205 line = strings.TrimSpace(line)
206 if after, ok := strings.CutPrefix(line, "# "); ok {
207 return after
208 }
209 }
210 return ""
211}
212
213// Loader 规则加载器接口
214type Loader interface {

Callers 1

parseMarkdownRulesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected