sr-npm 1.7.1261 → 1.7.1263
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -119,8 +119,10 @@ async function htmlRichContentConverter(sections,richContentConverterToken,jobNa
|
|
|
119
119
|
const richContentObject = {}
|
|
120
120
|
for (const [sectionTitle, sectionData] of Object.entries(sections)) {
|
|
121
121
|
if (sectionData.text) {
|
|
122
|
+
// Strip span tags but keep their content
|
|
123
|
+
const cleanedHtml = sectionData.text.replace(/<\/?span[^>]*>/gi, '');
|
|
122
124
|
const raw = JSON.stringify({
|
|
123
|
-
content:
|
|
125
|
+
content: cleanedHtml,
|
|
124
126
|
});
|
|
125
127
|
const requestOptions = {
|
|
126
128
|
method: 'post',
|
|
@@ -137,8 +139,8 @@ async function htmlRichContentConverter(sections,richContentConverterToken,jobNa
|
|
|
137
139
|
);
|
|
138
140
|
if (response.ok) {
|
|
139
141
|
const data = await response.json();
|
|
140
|
-
// const richContentWithSpacing=addSpacingToRichContent(
|
|
141
|
-
const richContentWithSpacing=addEmptyParagraphsBetweenConsecutive(
|
|
142
|
+
// const richContentWithSpacing=addSpacingToRichContent(cleanedHtml,data.richContent.richContent);
|
|
143
|
+
const richContentWithSpacing=addEmptyParagraphsBetweenConsecutive(cleanedHtml,data.richContent.richContent,jobName);
|
|
142
144
|
richContentObject[sectionTitle] = richContentWithSpacing
|
|
143
145
|
}
|
|
144
146
|
else {
|
|
@@ -333,14 +335,12 @@ function createEmptyParagraph(id) {
|
|
|
333
335
|
// Adds empty paragraph nodes between consecutive paragraphs and before lists
|
|
334
336
|
function addEmptyParagraphsBetweenConsecutive(html, richContent,jobName) {
|
|
335
337
|
console.log("jobName is : ",jobName);
|
|
336
|
-
if(jobName.name==="
|
|
338
|
+
if(jobName.name==="Assistant Store Manager - Noel Leeming Albany")
|
|
337
339
|
{
|
|
338
340
|
console.log("rich content is : ",richContent);
|
|
339
341
|
console.log("html is : ",html);
|
|
340
342
|
}
|
|
341
343
|
if (!richContent || !richContent.nodes) return richContent;
|
|
342
|
-
html = html.replace(/<\/?span[^>]*>/gi, '');
|
|
343
|
-
console.log("html is after : ",html);
|
|
344
344
|
const hasConsecutiveParagraphs = /<\/p>\s*<p/i.test(html);
|
|
345
345
|
const hasParagraphBeforeList = /<\/p>\s*<ul/i.test(html);
|
|
346
346
|
const hasParagraphAfterList = /<\/ul>\s*<p/i.test(html);
|