Join paragraph lines with space instead of newlines

Paragraphs now flow as continuous text, with only actual paragraph
breaks (large Y gaps) creating newlines between them.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Abimael Martell
2026-02-07 13:52:40 -08:00
co-authored by Claude Opus 4.5
parent 5f772071e4
commit ca09103ca9
2 changed files with 49 additions and 24 deletions
+16 -20
View File
@@ -1,34 +1,30 @@
PDF to Markdown Conversion
==========================
File: samples/doc.pdf
Type: TEXT-BASED (direct extraction)
Pages: 1
Processing time: 2258ms
--- Markdown Output ---
Introduction
### Introduction to Crimp Contacts SAE-AS39029
Glenair brings a new perspective to the supply of high-performance Mil-Spec and commercial contacts: High Availability! Whether you need a standard duty socket for a MIL-DTL-28840 connector or an extended duty pin for MIL-DTL-38999 Series III, we have you covered with products that are always in
stock—with no dollar or quantity minimums. In addition to the broadest selection and availability, Glenair also delivers outstanding interconnection compatibility. Glenair QPL SAE-AS39029 as well as our proprietary contact series are guaranteed to mate properly and perform at the upper limits of application requirements.
Glenair brings a new perspective to the supply of high-performance Mil-Spec and commercial contacts: High Availability! Whether you need a standard duty socket for a MIL-DTL-28840 connector or an extended duty pin for MIL-DTL-38999 Series III, we have you covered with products that are always in stock—with no dollar or quantity minimums. In addition to the broadest selection and availability, Glenair also delivers outstanding interconnection compatibility. Glenair QPL SAE-AS39029 as well as our proprietary contact series are guaranteed to mate properly and perform at the upper limits of application requirements.
### About SAE AS39029 Crimp Contacts
In a marketplace saturated with specialty interconnection media, the SAE-AS39029 crimp contact is still the “bread and butter” of the circular connector world. Serving platforms like the D38999, M28840 and countless others, AS39029 crimp contacts continue to offer reliable power and signal transmission in
ruggedized applications. A myriad of sizes, termination options and materials mean that end users dont have to compromise performance or reliability.
In a marketplace saturated with specialty interconnection media, the SAE-AS39029 crimp contact is still the “bread and butter” of the circular connector world. Serving platforms like the D38999, M28840 and countless others, AS39029 crimp contacts continue to offer reliable power and signal transmission in ruggedized applications. A myriad of sizes, termination options and materials mean that end users dont have to compromise performance or reliability.
Crimping results in a gas tight connection between the wire and its terminal. Although there are certainly alternatives to crimping, such as ultrasonic welding, resistance welding, insulation displacement technologies and so on, no other available technology delivers the short cycle times, flexibility and low overall cost of
crimping—making it the termination technology of choice for most high-performance connector systems. Crimp connectors are most commonly used to terminate stranded wire. Crimp-on terminals are attached by inserting the stripped end of the wire into the barrel end of the terminal, which is then mechanically
deformed (crimped). Special crimp tools are a must, and are supplied with appropriate accessory attachments to ensure reliable terminations for every wire and contact combination. Military Specification MIL-DTL-22520 provides the aerospace/defense industry with a common set of rugged, reliable hand crimp tools. This
specification controls the voltage drop and tensile strength of crimp terminations. Daniels Manufacturing Corporation is the leading manufacturer of these tools. The AS39029 product series supplied by Glenair includes all the most popular standard and extended duty
pin and socket contacts for use in high-performance circular and rectangular multi-pin connectors. We are also well positioned to supply special-purpose contacts to meet unique application requirements.
Crimping results in a gas tight connection between the wire and its terminal. Although there are certainly alternatives to crimping, such as ultrasonic welding, resistance welding, insulation displacement technologies and so on, no other available technology delivers the short cycle times, flexibility and low overall cost of crimping—making it the termination technology of choice for most high-performance connector systems. Crimp connectors are most commonly used to terminate stranded wire. Crimp-on terminals are attached by inserting the stripped end of the wire into the barrel end of the terminal, which is then mechanically deformed (crimped). Special crimp tools are a must, and are supplied with appropriate accessory attachments to ensure reliable terminations for every wire and contact combination. Military Specification MIL-DTL-22520 provides the aerospace/defense industry with a common set of rugged, reliable hand crimp tools. This specification controls the voltage drop and tensile strength of crimp terminations. Daniels Manufacturing Corporation is the leading manufacturer of these tools. The AS39029 product series supplied by Glenair includes all the most popular standard and extended duty pin and socket contacts for use in high-performance circular and rectangular multi-pin connectors. We are also well positioned to supply special-purpose contacts to meet unique application requirements.
#### High-Performance Connector with Crimp Contacts (Cutaway View)
Insert Retention Clip EMI Spring
Insert Retention Clip
Crimp Pin Environmental Environmental Contact Grommet Grommet
Insert Retention Clip EMI Spring Insert Retention Clip Crimp Pin Environmental Environmental Contact Grommet Grommet
Crimp Socket Contact with Hood RTV Sealing
Interfacial Seal
Connector Shell Contact Retention Clip
Insulators
Crimp Socket Contact with Hood RTV Sealing Interfacial Seal Connector Shell Contact Retention Clip Insulators
© 2011 Glenair, Inc. Printed in U.S.A. CAGE Code 06324
www.glenair.com E-Mail: sales@glenair.com
GLENAIR, INC. • 1211 AIR WAY • GLENDALE, CA 91201-2497 • 818-247-6000 • FAX 818-500-9912
INTRO-2
© 2011 Glenair, Inc. Printed in U.S.A. CAGE Code 06324 www.glenair.com E-Mail: sales@glenair.com GLENAIR, INC. • 1211 AIR WAY • GLENDALE, CA 91201-2497 • 818-247-6000 • FAX 818-500-9912 INTRO-2
+33 -4
View File
@@ -114,12 +114,17 @@ pub fn to_markdown_from_lines(lines: Vec<TextLine>, options: MarkdownOptions) ->
let mut current_page = 0u32;
let mut prev_y = f32::MAX;
let mut in_list = false;
let mut in_paragraph = false;
for line in lines {
// Page break
if line.page != current_page {
if current_page > 0 {
output.push_str("\n---\n\n");
if in_paragraph {
output.push_str("\n\n");
in_paragraph = false;
}
output.push_str("---\n\n");
}
current_page = line.page;
prev_y = f32::MAX;
@@ -127,11 +132,15 @@ pub fn to_markdown_from_lines(lines: Vec<TextLine>, options: MarkdownOptions) ->
// Paragraph break (large Y gap)
let y_gap = prev_y - line.y;
if y_gap > base_size * 2.0 && !output.ends_with("\n\n") {
let is_para_break = y_gap > base_size * 2.0;
if is_para_break {
if in_paragraph {
output.push_str("\n\n");
in_paragraph = false;
}
if in_list {
in_list = false;
}
output.push('\n');
}
prev_y = line.y;
@@ -147,6 +156,10 @@ pub fn to_markdown_from_lines(lines: Vec<TextLine>, options: MarkdownOptions) ->
if options.detect_headers && trimmed.len() > 3 {
let line_font_size = line.items.first().map(|i| i.font_size).unwrap_or(base_size);
if let Some(header_level) = detect_header_level(line_font_size, base_size) {
if in_paragraph {
output.push_str("\n\n");
in_paragraph = false;
}
let prefix = "#".repeat(header_level);
output.push_str(&format!("{} {}\n\n", prefix, trimmed));
in_list = false;
@@ -156,6 +169,10 @@ pub fn to_markdown_from_lines(lines: Vec<TextLine>, options: MarkdownOptions) ->
// Detect list items
if options.detect_lists && is_list_item(trimmed) {
if in_paragraph {
output.push_str("\n\n");
in_paragraph = false;
}
let formatted = format_list_item(trimmed);
output.push_str(&formatted);
output.push('\n');
@@ -172,13 +189,25 @@ pub fn to_markdown_from_lines(lines: Vec<TextLine>, options: MarkdownOptions) ->
if options.detect_code {
let is_mono = line.items.iter().any(|i| is_monospace_font(&i.font));
if is_mono {
if in_paragraph {
output.push_str("\n\n");
in_paragraph = false;
}
output.push_str(&format!("```\n{}\n```\n", trimmed));
continue;
}
}
// Regular text
// Regular text - join lines within same paragraph with space
if in_paragraph {
output.push(' ');
}
output.push_str(trimmed);
in_paragraph = true;
}
// Close final paragraph
if in_paragraph {
output.push('\n');
}