returns how many times each placeholder is present in the document
almost the same code as `getVariables`
useful when cloning a block a number of times and want to replace
placeholders that are present more than once in the block
(using the `$limit` parameter of `setValue`)