Expand description
Previews and truncation of text and HTML bodies.
Functionsยง
- preview_
html - A text preview of an HTML document:
crate::html_to_textof the document cut likepreview_text. Only the part of the document that the preview needs is converted. - preview_
text - At most
max_lenbytes oftext, carriage returns removed. Longer text is cut at a character boundary and, whenmax_lenis 7 or more, ends with...(counted inmax_len). Borrowed when the text fits and has no carriage return. - truncate_
html - At most
max_lenbytes of an HTML document, carriage returns removed. A longer document is cut before a tag rather than inside one and, whenmax_lenis 7 or more, ends with.... Borrowed when the document fits and has no carriage return. - truncate_
text - Truncates text for display; the same as
preview_text.