sr-npm 1.7.1249 → 1.7.1252
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.
|
@@ -162,6 +162,8 @@ function addSpacingToRichContent(html, richContent) {
|
|
|
162
162
|
const htmlParagraphsWithBr = new Map(); // text -> array of parts split by <br>
|
|
163
163
|
// Check if HTML has consecutive paragraphs (</p><p> pattern)
|
|
164
164
|
const hasConsecutiveParagraphs = /<\/p>\s*<p/i.test(html);
|
|
165
|
+
// Check if HTML has paragraph followed by list (</p><ul> pattern)
|
|
166
|
+
const hasParagraphBeforeList = /<\/p>\s*<ul/i.test(html);
|
|
165
167
|
|
|
166
168
|
const pTagRegex = /<p>(.*?)<\/p>/gi;
|
|
167
169
|
let match;
|
|
@@ -215,6 +217,11 @@ function addSpacingToRichContent(html, richContent) {
|
|
|
215
217
|
return true;
|
|
216
218
|
}
|
|
217
219
|
|
|
220
|
+
// If HTML has </p><ul> and next node is a list, add spacing
|
|
221
|
+
if (hasParagraphBeforeList && nextNode && nextNode.type === 'BULLETED_LIST') {
|
|
222
|
+
return true;
|
|
223
|
+
}
|
|
224
|
+
|
|
218
225
|
const text = node.nodes?.[0]?.textData?.text || '';
|
|
219
226
|
const trimmedText = text.trim();
|
|
220
227
|
|