From e4de656382723e8f4b56b24820f49d2f6a0cb570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateu=20Aguil=C3=B3=20Bosch?= Date: Wed, 5 Jan 2022 16:18:15 +0100 Subject: [PATCH] fix: use CL instead of SB (#4) --- src/fetchStoryHtml.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fetchStoryHtml.ts b/src/fetchStoryHtml.ts index 0f86703..1c525db 100644 --- a/src/fetchStoryHtml.ts +++ b/src/fetchStoryHtml.ts @@ -23,7 +23,7 @@ const fetchStoryHtml = async ( const variant = context.parameters.options.variant; - const fetchUrl = new URL(`${url}/_sb_server`); + const fetchUrl = new URL(`${url}/_cl_server`); fetchUrl.search = new URLSearchParams({ ...params, _storyFileName: context.parameters.fileName, @@ -40,10 +40,10 @@ const fetchStoryHtml = async ( const response = await fetch(fetchUrl.toString()); const htmlContents = await response.text(); // The HTML contents Drupal sends back includes regions, blocks, menus, etc. - // We need to extract the HTML for the ___sb-wrapper. + // We need to extract the HTML for the ___cl-wrapper. const parser = new DOMParser(); const htmlDoc = parser.parseFromString(htmlContents, 'text/html'); - const sbWrapper = htmlDoc.getElementById('___sb-wrapper'); + const sbWrapper = htmlDoc.getElementById('___cl-wrapper'); // Extract the missing scripts and re-add them. // @todo Should we only get the scripts from htmlDoc.body.getElementsByTagName('script')? const scripts = htmlDoc.getElementsByTagName('script');