(r io.Reader, source string)
| 198 | } |
| 199 | |
| 200 | func readMarkdownDiffPayload(r io.Reader, source string) ([]byte, error) { |
| 201 | payload, err := io.ReadAll(io.LimitReader(r, markdownDiffMaxContentBytes+1)) |
| 202 | if err != nil { |
| 203 | return nil, err |
| 204 | } |
| 205 | if len(payload) > markdownDiffMaxContentBytes { |
| 206 | return nil, markdownValidationError("%s exceeds %s markdown +diff content limit", source, common.FormatSize(markdownDiffMaxContentBytes)) |
| 207 | } |
| 208 | return payload, nil |
| 209 | } |
| 210 | |
| 211 | func splitMarkdownDiffLines(text string) []string { |
| 212 | if text == "" { |
no test coverage detected