html to text
This block is part of the value group and was last modified in core v15.0.2.
html to text v15.0.2 Turns HTML into one line of plain text: tags removed, every HTML entity decoded and whitespace collapsed. Set max length to cut the text on a word boundary.
- html
valuerequiredThe HTML to convert.
- max length
numberThe longest the text may be, in characters. It is cut on a word boundary. Leave empty or 0 for no limit.
- value
value - truncated
conditionTrue when the text was cut to max length. Nothing is appended to it; add an ellipsis yourself if you want one.
Outputs the plain text of the html input as ONE line: script, style, head and title elements are dropped with their contents, comments removed, block boundaries/breaks/list items/table cells become a space, every other tag is removed without a space (a<b>c</b> -> "ac"), then ALL HTML entities are decoded (named and numeric; becomes a space) and runs of whitespace collapse to one space, trimmed. Entities are decoded after the tags are gone, so escaped markup stays visible ("<b>" -> "<b>"). max_length > 0 caps the result at that many characters (not bytes), ending on a word boundary: a word the cap falls inside is dropped, a single word longer than the cap is cut hard. No ellipsis is appended; truncated is true when anything was cut. Unwired html outputs "". Example: "<p>Hello <b>world</b></p><p>A & B</p>" -> "Hello world A & B".
strip html |
strip tags |
html to plain text |
remove html |
Version history
Introduced in v15.0.2.
Back to
value Return to the main group to view all sub-groups Back to value Return to the group to view all blocks within this group