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)
| 17 | // unless the user overrides with an environment variable. |
| 18 | // If 0 is passed then wrapping is disabled. |
| 19 | func 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 | |
| 30 | func WithTheme(theme string) glamour.TermRendererOption { |
| 31 | return ghMarkdown.WithTheme(theme) |
no outgoing calls
no test coverage detected