Skip to main content

Crate pdf2md_tidy

Crate pdf2md_tidy 

Source
Expand description

Clean up Markdown that was converted from a PDF.

PDF extraction leaves three recurring problems behind: paragraphs that are hard-wrapped at the original column width, heading levels that start at an arbitrary depth, and pipe tables whose columns no longer line up. This crate fixes those three and leaves everything else alone.

The Markdown it is written against is the output of the browser-based converter at https://pdf2md.me, which runs the conversion locally and preserves tables and heading levels, but any CommonMark source works.

let out = pdf2md_tidy::run("### Title\n\nline one\nline two", pdf2md_tidy::Options::default());
assert!(out.starts_with("# Title"));

Structs§

Options
Which clean-up passes to run.

Functions§

run
Apply the selected passes to src and return the cleaned Markdown.