Skip to content

Commit

Permalink
fix: use CL instead of SB (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
e0ipso authored Jan 5, 2022
1 parent e358677 commit e4de656
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/fetchStoryHtml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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');
Expand Down

0 comments on commit e4de656

Please sign in to comment.