Skip to content

Commit c2a37d3

Browse files
authored
feat: handle support for br tag inside inline elements (#34)
Signed-off-by: K-Kumar-01 <[email protected]>
1 parent 7c133d8 commit c2a37d3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/helpers/xml-builder.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,11 @@ const buildRun = async (vNode, attributes, docxDocumentInstance) => {
928928
// do not slice and concat children since this is already accounted for in the buildRunOrRuns function
929929
// eslint-disable-next-line no-continue
930930
continue;
931+
} else if (tempVNode.tagName === 'br') {
932+
const lineBreakFragment = buildLineBreak();
933+
runFragmentsArray.push(lineBreakFragment);
931934
}
935+
// TODO: check if picture can occur inside inline elements(not span)
932936
}
933937

934938
if (tempVNode.children && tempVNode.children.length) {

0 commit comments

Comments
 (0)