sr-npm 1.7.1260 → 1.7.1262
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 {
|
|
@@ -339,7 +341,8 @@ if(jobName.name===" Apparel Team Member - The Warehouse, Dargaville")
|
|
|
339
341
|
console.log("html is : ",html);
|
|
340
342
|
}
|
|
341
343
|
if (!richContent || !richContent.nodes) return richContent;
|
|
342
|
-
|
|
344
|
+
html = html.replace(/<\/?span[^>]*>/gi, '');
|
|
345
|
+
console.log("html is after : ",html);
|
|
343
346
|
const hasConsecutiveParagraphs = /<\/p>\s*<p/i.test(html);
|
|
344
347
|
const hasParagraphBeforeList = /<\/p>\s*<ul/i.test(html);
|
|
345
348
|
const hasParagraphAfterList = /<\/ul>\s*<p/i.test(html);
|