Skip to content

text_bodies does not seem to return a useful iterator #73

Open
@Bengreen

Description

@Bengreen

The iterator returned by text_bodies returns an object that is not necessarily a text element. But can become a text element.

Perhaps it might be better to have an iterator that returns a generic object that can be converted to text using functions such as those found in body_text (https://github.com/stalwartlabs/mail-parser/blob/65533d3faf6f147fa288fa30eae0bb4df80b2948/src/core/message.rs#L407C12-L407C21)
and perhaps make the body_text function generically available as a helper function rather than a method.

Alternatively include the text transforms of body_text to be included in the iterator of text_bodies so that the relevant text is returned.

What I found difficult about the current implementation is that an iterator using the text code returns "<html><p>I was thinking about quitting the &ldquo;exporting&rdquo; to focus just on the &ldquo;importing&rdquo;,</p><p>but then I thought, why not do both? &#x263A;</p></html>" for .text_contents() rather than I was thinking about quitting the “exporting” to focus just on the “importing”, but then I thought, why not do both? ☺ which would seem a more natural return.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions