mirror of
https://github.com/jzillmann/pdf-to-markdown.git
synced 2025-02-16 18:00:46 +01:00
WIP fix bugs
This commit is contained in:
parent
2783d724e5
commit
edfa76b033
@ -65,7 +65,7 @@ export default class CalculateGlobalStats extends ToPdfViewTransformation {
|
|||||||
parseResult.content.forEach(page => {
|
parseResult.content.forEach(page => {
|
||||||
var lastItemOfMostUsedHeight;
|
var lastItemOfMostUsedHeight;
|
||||||
page.textItems.forEach(item => {
|
page.textItems.forEach(item => {
|
||||||
if (item.height == mostUsedHeight) {
|
if (item.height == mostUsedHeight && item.text.trim().length > 0) {
|
||||||
if (lastItemOfMostUsedHeight && item.y != lastItemOfMostUsedHeight.y) {
|
if (lastItemOfMostUsedHeight && item.y != lastItemOfMostUsedHeight.y) {
|
||||||
const distance = lastItemOfMostUsedHeight.y - item.y;
|
const distance = lastItemOfMostUsedHeight.y - item.y;
|
||||||
if (distance > 0) {
|
if (distance > 0) {
|
||||||
|
@ -68,6 +68,7 @@ export default class DetectCodeBlocks extends ToPdfBlockViewTransformation {
|
|||||||
annotation: ADDED_ANNOTATION,
|
annotation: ADDED_ANNOTATION,
|
||||||
textItems: textCombiner.combine(block.textItems)
|
textItems: textCombiner.combine(block.textItems)
|
||||||
});
|
});
|
||||||
|
foundBlocks++;
|
||||||
}
|
}
|
||||||
newBlocks.push(preceedingCodeBlock);
|
newBlocks.push(preceedingCodeBlock);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user