MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / ParsedBody

Function ParsedBody

internal/mailparse/parse.go:88–91  ·  view source on GitHub ↗

ParsedBody extracts the injection-reduced text (see ParsedView.Text). truncated is true when the cap cut content. maxBytes <= 0 uses DefaultMaxBytes. Retained for callers that only need the text; callers wanting HTML use Parse.

(raw []byte, maxBytes int)

Source from the content-addressed store, hash-verified

86// truncated is true when the cap cut content. maxBytes <= 0 uses DefaultMaxBytes.
87// Retained for callers that only need the text; callers wanting HTML use Parse.
88func ParsedBody(raw []byte, maxBytes int) (text string, truncated bool) {
89 v := Parse(raw, maxBytes)
90 return v.Text, v.Truncated
91}
92
93// runeBoundary returns the largest index <= n that doesn't split a UTF-8 rune,
94// so truncating at it never yields an invalid encoding.

Callers 4

TestParsedBodyFunction · 0.85
TestDeepNestingBoundedFunction · 0.85
TestBase64DecodedFunction · 0.85

Calls 1

ParseFunction · 0.85

Tested by 4

TestParsedBodyFunction · 0.68
TestDeepNestingBoundedFunction · 0.68
TestBase64DecodedFunction · 0.68