MCPcopy
hub / github.com/cli/cli / WithWrap

Function WithWrap

pkg/markdown/markdown.go:19–28  ·  view source on GitHub ↗

WithWrap is a rendering option that set the character limit for soft wrapping the markdown rendering. There is a max limit of 120 characters, unless the user overrides with an environment variable. If 0 is passed then wrapping is disabled.

(w int)

Source from the content-addressed store, hash-verified

17// unless the user overrides with an environment variable.
18// If 0 is passed then wrapping is disabled.
19func WithWrap(w int) glamour.TermRendererOption {
20 width, err := strconv.Atoi(os.Getenv("GH_MDWIDTH"))
21 if err != nil {
22 width = 120
23 }
24 if w > width {
25 w = width
26 }
27 return ghMarkdown.WithWrap(w)
28}
29
30func WithTheme(theme string) glamour.TermRendererOption {
31 return ghMarkdown.WithTheme(theme)

Callers 15

printHumanViewFunction · 0.92
printHumanCommentFunction · 0.92
renderReleaseTTYFunction · 0.92
renderMarkdownWithFormatFunction · 0.92
printResultsFunction · 0.92
longPagerFunction · 0.92
printHumanIssuePreviewFunction · 0.92
viewRunFunction · 0.92
viewRunFunction · 0.92
renderMarkdownPreviewFunction · 0.92
printHumanPrPreviewFunction · 0.92
formatCommentFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected