mirror of
https://github.com/jzillmann/pdf-to-markdown.git
synced 2025-06-30 22:30:03 +02:00
Prevent headline detection code from detecting headline > 6
This commit is contained in:
@ -67,6 +67,8 @@ 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 headlineLevel = i + 2;
|
||||||
|
if (headlineLevel <= 6) {
|
||||||
const headlineType = headlineByLevel(2 + i);
|
const headlineType = headlineByLevel(2 + i);
|
||||||
parseResult.pages.forEach(page => {
|
parseResult.pages.forEach(page => {
|
||||||
page.items.forEach(item => {
|
page.items.forEach(item => {
|
||||||
@ -77,6 +79,7 @@ export default class DetectHeaders extends ToLineItemTransformation {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user