wrap

Wraps the output in a given HTML tag. This filter can be used directly on a render array, and only returns a wrapped string if the render array generated output.

{{ node.title|wrap('h3') wraps the node title with a <h3> tag.