Skip to content
M. Mikkel Rummelhoff edited this page Mar 5, 2018 · 1 revision

This filter will remove the parent node for any matching selectors (retaining all child nodes for both parent and affected element)

Usage/examples

Unwrap all img tags

{{ entry.body | retconUnwrap( 'img' ) }}

Unwrap all img and span tags

{{ entry.body | retconUnwrap( [ 'img', 'span' ] ) }}

Unwrap all elements with the classname ".foo"

{{ entry.body | retconUnwrap( '.foo' ) }}

Parameters

@selectors Mixed
String value or Array of string values
Examples: "p" ".foo" "#bar" "div.baz"