Skip to content

Commit

Permalink
add additional guidance (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
martyncolmer authored Mar 4, 2022
1 parent 16cbcf2 commit ee21bee
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
22 changes: 19 additions & 3 deletions src/eq_schema/block-types/Introduction/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Introduction {
description,
secondaryTitle,
secondaryDescription,
additionalGuidancePanel,
collapsibles,
tertiaryTitle,
tertiaryDescription,
Expand All @@ -33,7 +34,8 @@ class Introduction {
) {
this.id = "introduction-block";
this.type = "Introduction";
this.primary_content = [
this.primary_content = []
this.primary_content.push(
{
id: "primary",
title: buildIntroductionTitle(),
Expand All @@ -43,12 +45,26 @@ class Introduction {
contactDetailsEmailSubject,
contactDetailsIncludeRuRef
),
},
}
);
if(additionalGuidancePanel) {
this.primary_content.push(
{
id: "additional_guidance",
contents: {
guidance: {
contents: this.buildContents(additionalGuidancePanel, ctx),
},
},
}
);
}
this.primary_content.push(
{
id: "description",
contents: this.buildContents(description, ctx),
},
];
);
this.preview_content = {
id: "preview",
title: this.buildTitle(secondaryTitle, ctx),
Expand Down
2 changes: 1 addition & 1 deletion src/utils/HTMLUtils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { replace } = require("lodash/fp");
const isPlainText = (elem) => typeof elem === "string" && !elem.startsWith("<");

const startsWithLink = (elem) =>
typeof elem === "string" && elem.startsWith("<a");
typeof elem === "string" && (elem.startsWith("<a") || elem.startsWith("<strong>")) ;

const getInnerHTML = (elem) =>
isPlainText(elem) || startsWithLink(elem) ? elem : cheerio(elem).html();
Expand Down

0 comments on commit ee21bee

Please sign in to comment.