Started to dive into Drupal 8 twig, and what better place to start than from the top: html.html.twig
But found this:
<head-placeholder token="{{ placeholder_token|raw }}">
Here is the change record:
And some related issues:
- #2538950: Replace SafeMarkup::format() in template_preprocess_html with placeholders in the template
- #2603074: Remove |raw from use in core templates
And the documentation:
But nothing really clarifies why this was done.
Is this a Drupalism? A Twigism? What are these tokens for?
The only other time I've seen a placeholder token system like this was with CTools where they create a placeholder in the generated HTML output and then go back later and replace the token with the actual value. If this is the same concept, why does Drupal core need to do this? (The CTools system was ostensibly to get around some core limitations).