@uniweb/semantic-parser 1.1.16 → 1.1.17
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/processors/groups.js +12 -0
package/package.json
CHANGED
package/src/processors/groups.js
CHANGED
|
@@ -480,6 +480,18 @@ function processInlineElements(children, body) {
|
|
|
480
480
|
children.forEach((item) => {
|
|
481
481
|
if (item.type === "icon") {
|
|
482
482
|
body.icons.push(item.attrs);
|
|
483
|
+
} else if (item.type === "image") {
|
|
484
|
+
// Inline image inside a paragraph (e.g. `` next to
|
|
485
|
+
// text or icons that didn't qualify for block-level hoisting
|
|
486
|
+
// in content-reader). Mirror the top-level partition:
|
|
487
|
+
// icon-role goes to icons[], everything else to images[].
|
|
488
|
+
// Without this branch, inline images vanish from body.images
|
|
489
|
+
// and components reading `item.images?.[0]` see nothing.
|
|
490
|
+
if (item.attrs?.role === "icon") {
|
|
491
|
+
body.icons.push(item.attrs);
|
|
492
|
+
} else {
|
|
493
|
+
body.images.push(item.attrs);
|
|
494
|
+
}
|
|
483
495
|
} else if (item.type === "link") {
|
|
484
496
|
// Handle inline links extracted from paragraph text nodes
|
|
485
497
|
body.links.push(item.attrs);
|