MCPcopy Index your code
hub / github.com/cli/cli / renderRawMarkdown

Function renderRawMarkdown

pkg/cmd/agent-task/shared/log.go:298–306  ·  view source on GitHub ↗

renderRawMarkdown renders the given raw markdown string to the given writer. Use for complete markdown content from tool calls that need no conversion.

(md string, w io.Writer, io *iostreams.IOStreams)

Source from the content-addressed store, hash-verified

296// renderRawMarkdown renders the given raw markdown string to the given writer.
297// Use for complete markdown content from tool calls that need no conversion.
298func renderRawMarkdown(md string, w io.Writer, io *iostreams.IOStreams) error {
299 // Glamour doesn't add leading newlines when content is a complete
300 // markdown document. So, we must add the leading newline.
301 formatFunc := func(s string) string {
302 return fmt.Sprintf("\n%s\n\n", s)
303 }
304
305 return renderMarkdownWithFormat(md, w, io, formatFunc)
306}
307
308// renderMarkdownWithFormat renders the given markdown string to the given writer.
309// If a formatFunc is provided, the md string is ran through it before

Callers 3

renderLogEntryFunction · 0.85

Calls 1

renderMarkdownWithFormatFunction · 0.85

Tested by

no test coverage detected