mirror of
https://github.com/jzillmann/pdf-to-markdown.git
synced 2025-01-24 06:29:06 +01:00
combine on Y with variation of 1 (instead of being strict)
This commit is contained in:
parent
a1222544bb
commit
ab5705cd27
@ -71,7 +71,7 @@ export default class CombineSameY extends Transformation {
|
||||
}
|
||||
|
||||
pdfPage.textItems.forEach(textItem => {
|
||||
if (textItemsWithSameY.length == 0 || textItem.y == textItemsWithSameY[textItemsWithSameY.length - 1].y) {
|
||||
if (textItemsWithSameY.length == 0 || Math.abs(textItem.y - textItemsWithSameY[textItemsWithSameY.length - 1].y) < 2) {
|
||||
//fill array
|
||||
textItemsWithSameY.push(textItem);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user