@@ -261,7 +261,7 @@ Subscribing
261261
262262Subscribing to updates in JavaScript from a Twig template is straightforward:
263263
264- .. code-block :: twig
264+ .. code-block :: html+ twig
265265
266266 <script>
267267 const eventSource = new EventSource("{{ mercure('https://example.com/books/1')|escape('js') }}");
@@ -278,7 +278,7 @@ parameters corresponding to the topics passed as first argument.
278278If you want to access to this URL from an external JavaScript file, generate the
279279URL in a dedicated HTML element:
280280
281- .. code-block :: twig
281+ .. code-block :: html+ twig
282282
283283 <script type="application/json" id="mercure-url">
284284 {{ mercure('https://example.com/books/1')|json_encode(constant('JSON_UNESCAPED_SLASHES') b-or constant('JSON_HEX_TAG'))|raw }}
@@ -296,7 +296,7 @@ Mercure also allows subscribing to several topics,
296296and to use URI Templates or the special value ``* `` (matched by all topics)
297297as patterns:
298298
299- .. code-block :: twig
299+ .. code-block :: html+ twig
300300
301301 <script>
302302 {# Subscribe to updates of several Book resources and to all Review resources matching the given pattern #}
@@ -427,7 +427,7 @@ passed by the browsers to the Mercure hub if the ``withCredentials`` attribute
427427of the ``EventSource `` class is set to ``true ``. Then, the Hub verifies the
428428validity of the provided JWT, and extract the topic selectors from it.
429429
430- .. code-block :: twig
430+ .. code-block :: html+ twig
431431
432432 <script>
433433 const eventSource = new EventSource("{{ mercure('https://example.com/books/1', { subscribe: 'https://example.com/books/1' })|escape('js') }}", {
@@ -455,7 +455,7 @@ is the way to go.
455455 The native implementation of EventSource doesn't allow specifying headers.
456456 For example, authorization using a Bearer token. In order to achieve that, use `a polyfill `_
457457
458- .. code-block :: twig
458+ .. code-block :: html+ twig
459459
460460 <script>
461461 const es = new EventSourcePolyfill("{{ mercure('https://example.com/books/1') }}", {
0 commit comments