mirror of
https://github.com/jzillmann/pdf-to-markdown.git
synced 2024-11-21 23:33:31 +01:00
Prevent headline detection code from detecting headline > 6
This commit is contained in:
parent
908f0b4be1
commit
ecde2ea0f5
@ -67,16 +67,19 @@ export default class DetectHeaders extends ToLineItemTransformation {
|
|||||||
heights.sort((a, b) => b - a);
|
heights.sort((a, b) => b - a);
|
||||||
|
|
||||||
heights.forEach((height, i) => {
|
heights.forEach((height, i) => {
|
||||||
const headlineType = headlineByLevel(2 + i);
|
const headlineLevel = i + 2;
|
||||||
parseResult.pages.forEach(page => {
|
if (headlineLevel <= 6) {
|
||||||
page.items.forEach(item => {
|
const headlineType = headlineByLevel(2 + i);
|
||||||
if (!item.type && item.height == height && !isListItem(item.text())) {
|
parseResult.pages.forEach(page => {
|
||||||
detectedHeaders++;
|
page.items.forEach(item => {
|
||||||
item.annotation = DETECTED_ANNOTATION;
|
if (!item.type && item.height == height && !isListItem(item.text())) {
|
||||||
item.type = headlineType;
|
detectedHeaders++;
|
||||||
}
|
item.annotation = DETECTED_ANNOTATION;
|
||||||
|
item.type = headlineType;
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user