statamic-var icon indicating copy to clipboard operation
statamic-var copied to clipboard

Variable modifiers not working with large amount of data

Open curtisblackwell opened this issue 10 years ago • 2 comments

I'm storing a bunch of HTML in a variable, then using {{ var:extract }} to get a word count, but it ends up way off.

{{ var:content_full }}{{ theme:partial src="replicator_default" }}{{ /var:content_full }}

{{ var:extract }}{{ content_full|word_count }}{{ /var:extract }}

This returns 28, but it should be 776.

I also tried using |striptags, but that just outputs the HTML. I tested using both |word_count and |striptags on {{ content }} (after pasting the HTML under the front matter in the file) and both work as expected.

curtisblackwell avatar Nov 19 '14 09:11 curtisblackwell

Hey Curtis, are you sure this is a problem with the plugin? Does it work when you try to copy the output of the {{theme:partial}} call directly between {{var}} and {{/var}}?

michaelhue avatar Nov 21 '14 16:11 michaelhue

Hey Michael,

Finally got around to testing this. It outputs the correct number when I use the partial output in place of the partial itself.

curtisblackwell avatar Nov 27 '14 02:11 curtisblackwell