Skip to content

Commit

Permalink
Fix text items misaligned if textContent items have both text and lin…
Browse files Browse the repository at this point in the history
…e break

Closes #1173
  • Loading branch information
wojtekmaj committed Nov 20, 2022
1 parent 7c1c925 commit b8d41fc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Page/TextLayer.jsx
Expand Up @@ -169,7 +169,8 @@ export class TextLayerInternal extends PureComponent {
this.endElement.current = end;

if (customTextRenderer) {
textContent.items.forEach((item, itemIndex) => {
let itemIndex = 0;
textContent.items.forEach((item) => {
const child = this.layerElement.current.children[itemIndex];

const content = customTextRenderer({
Expand All @@ -178,6 +179,7 @@ export class TextLayerInternal extends PureComponent {
});

child.innerHTML = content;
itemIndex += item.str && item.hasEOL ? 2 : 1;
});
}

Expand Down

0 comments on commit b8d41fc

Please sign in to comment.