mirror of
https://github.com/jzillmann/pdf-to-markdown.git
synced 2024-11-21 23:33:31 +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 => {
|
||||
var lastItemOfMostUsedHeight;
|
||||
page.textItems.forEach(item => {
|
||||
if (item.height == mostUsedHeight) {
|
||||
if (item.height == mostUsedHeight && item.text.trim().length > 0) {
|
||||
if (lastItemOfMostUsedHeight && item.y != lastItemOfMostUsedHeight.y) {
|
||||
const distance = lastItemOfMostUsedHeight.y - item.y;
|
||||
if (distance > 0) {
|
||||
|
@ -68,6 +68,7 @@ export default class DetectCodeBlocks extends ToPdfBlockViewTransformation {
|
||||
annotation: ADDED_ANNOTATION,
|
||||
textItems: textCombiner.combine(block.textItems)
|
||||
});
|
||||
foundBlocks++;
|
||||
}
|
||||
newBlocks.push(preceedingCodeBlock);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user