The indent trigger was using .abs() which fired on both increased indent (non-indented → indented) AND decreased indent (indented → non-indented). This caused drop-cap style paragraphs (indented first line, flush-left continuation) to incorrectly split into two blocks. Per plan Phase 4.4 heuristic #2, indent change should only trigger when the current line is MORE indented (to the right, larger x0) than the block average - i.e., a new paragraph starting after non-indented text. It should NOT trigger for decreased indent (first line indented, rest flush-left). Fix: Remove .abs() and only check if line_x0 - block_avg_x0 > threshold. Tests: - test_indented_first_line_new_block: PASS (non-indented → indented splits) - test_indented_first_line_of_paragraph_not_split: PASS (drop cap stays together) - All 179 line module tests: PASS
56 lines
1 KiB
TOML
56 lines
1 KiB
TOML
[workspace]
|
|
|
|
[package]
|
|
name = "xtask"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
license = "MIT OR Apache-2.0"
|
|
publish = false
|
|
|
|
[[bin]]
|
|
name = "xtask"
|
|
path = "src/main.rs"
|
|
|
|
[[bin]]
|
|
name = "gen_schema"
|
|
path = "src/bin/gen_schema.rs"
|
|
|
|
[[bin]]
|
|
name = "gen_cli_reference"
|
|
path = "src/bin/gen_cli_reference.rs"
|
|
|
|
[[bin]]
|
|
name = "migrate_schema"
|
|
path = "src/bin/migrate_schema.rs"
|
|
|
|
[[bin]]
|
|
name = "gen_scanned_fixtures"
|
|
path = "src/bin/gen_scanned_fixtures.rs"
|
|
|
|
[[bin]]
|
|
name = "gen_form_fixtures"
|
|
path = "src/bin/gen_form_fixtures.rs"
|
|
|
|
[[bin]]
|
|
name = "gen_encoding_fixtures"
|
|
path = "src/bin/gen_encoding_fixtures.rs"
|
|
|
|
[lib]
|
|
name = "pdftract_schema_migrate"
|
|
path = "src/lib.rs"
|
|
|
|
[dependencies]
|
|
serde = { version = "1.0", features = ["derive"] }
|
|
serde_json = "1.0"
|
|
serde_yaml = "0.9"
|
|
glob = "0.3"
|
|
humantime = "2.1"
|
|
lopdf = "0.34"
|
|
schemars = "1.2"
|
|
pdftract-core = { path = "../crates/pdftract-core", features = ["schemars"] }
|
|
fontdue = "0.9"
|
|
clap = { version = "4.5", features = ["derive"] }
|
|
clap-markdown = "0.1"
|
|
anyhow = "1.0"
|
|
printpdf = "0.9"
|
|
encoding_rs = "0.8"
|