findFirstImage
Finds the first image tag in a rendered HTML string and returns the src
attribute. This function can be used to extract the first image form a block variable to be used separately in any other place like a teaser section of a page card in a pagelist. To get the first image of a Markdown variable, the markdown
functions has to be applied before.
@{ +blocks | findFirstImage }
The first image within a Markdown variable can be extracted as follows:
@{ text | markdown | findFirstImage }