Skip to content

Commit aee4715

Browse files
CHORE SB Callout headings aren't necessarily h3s.
1 parent a43c63a commit aee4715

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/services/content-api/parsers/content-filter-service.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ function _extractCalloutHeading(response: ContentApiVaccineResponse): string {
142142
return "";
143143
}
144144

145-
const match = calloutElement.text.match(/<h3>(.*?)<\/h3>/);
145+
const match = calloutElement.text.match(/<h\d>(.*?)<\/h\d>/);
146146
return match ? match[1] : "";
147147
}
148148

@@ -153,8 +153,7 @@ function _extractCalloutContent(response: ContentApiVaccineResponse): string {
153153
return "";
154154
}
155155

156-
const content = calloutElement.text.replace(/<h3>.*?<\/h3>/, "").trim();
157-
156+
const content = calloutElement.text.replace(/<h\d>.*?<\/h\d>/, "").trim();
158157
return content;
159158
}
160159

test-data/content-api/data.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ export const genericVaccineContentAPIResponse: ContentApiVaccineResponse = {
564564
position: 0,
565565
"@type": "WebPageElement",
566566
name: "Callout",
567-
text: "<h3>Callout heading</h3><p>Callout content</p>",
567+
text: "<h2>Callout heading</h2><p>Callout content</p>",
568568
},
569569
],
570570
},

0 commit comments

Comments
 (0)