@nuasite/cms 0.7.2 → 0.7.3
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.
- package/package.json +1 -1
- package/src/html-processor.ts +8 -2
package/package.json
CHANGED
package/src/html-processor.ts
CHANGED
|
@@ -645,7 +645,12 @@ export async function processHtml(
|
|
|
645
645
|
// Only apply when includeTags is null or doesn't include 'span'
|
|
646
646
|
if (skipInlineStyleTags && (includeTags === null || !includeTags.includes('span')) && tag === 'span') {
|
|
647
647
|
const classAttr = node.getAttribute('class')
|
|
648
|
-
|
|
648
|
+
// Skip bare spans (no classes) - they're just text wrappers
|
|
649
|
+
if (!classAttr || !classAttr.trim()) {
|
|
650
|
+
return
|
|
651
|
+
}
|
|
652
|
+
// Skip styled spans (only text styling classes)
|
|
653
|
+
if (hasOnlyTextStyleClasses(classAttr)) {
|
|
649
654
|
return
|
|
650
655
|
}
|
|
651
656
|
}
|
|
@@ -711,7 +716,8 @@ export async function processHtml(
|
|
|
711
716
|
const hasDescendants = hasCandidateDescendants(node)
|
|
712
717
|
|
|
713
718
|
// Skip pure containers - they have no direct text and all content comes from children
|
|
714
|
-
|
|
719
|
+
// Exempt <a> elements - they have editable attributes (href)
|
|
720
|
+
if (!directText && hasDescendants && candidate.tag !== 'a') {
|
|
715
721
|
candidateNodes.delete(node) // Remove from candidates so nested checks stay accurate
|
|
716
722
|
continue
|
|
717
723
|
}
|