MCPcopy Create free account
hub / github.com/openclaw/gogcli / formatLink

Function formatLink

internal/docsformat/format.go:473–489  ·  view source on GitHub ↗
(value string)

Source from the content-addressed store, hash-verified

471}
472
473func formatLink(value string) (*docs.Link, error) {
474 link := strings.TrimSpace(value)
475 if link == "" {
476 return nil, ValidationError("--link target cannot be empty")
477 }
478
479 if target, ok := strings.CutPrefix(link, "#"); ok {
480 target = strings.TrimSpace(target)
481 if target == "" {
482 return nil, ValidationError("--link target cannot be empty")
483 }
484
485 return &docs.Link{BookmarkId: target}, nil
486 }
487
488 return &docs.Link{Url: link}, nil
489}
490
491func formatNamedStyle(headingLevel *int, namedStyle string) (string, error) {
492 trimmed := strings.ToUpper(strings.TrimSpace(namedStyle))

Callers 1

buildTextStyleRequestFunction · 0.85

Calls 1

ValidationErrorTypeAlias · 0.70

Tested by

no test coverage detected