Skip to content

Commit 77ab745

Browse files
authored
Bug fix: Renders all elements in an inline field in Live Preview
Related to #2557, I tracked that bug down to #2416 which introduced code rendering on the last element within an inline field, when in _Live preview_. Now we loop on all elements, and render them all.
1 parent 3031fbe commit 77ab745

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ui/render.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ async function renderCompactMarkdownForInlineFieldLivePreview(
4242
await MarkdownRenderer.render(app, markdown, tmpContainer, sourcePath, component);
4343
let paragraph = tmpContainer.querySelector(":scope > p");
4444
if (tmpContainer.childNodes.length == 1 && paragraph) {
45-
container.appendChild(paragraph.childNodes.item(paragraph.childNodes.length - 1));
45+
while (paragraph.firstChild) {
46+
container.appendChild(paragraph.firstChild);
47+
}
4648
} else {
4749
container.replaceChildren(...tmpContainer.childNodes);
4850
}

0 commit comments

Comments
 (0)