From 258210a82195cc6c4d7c959e02d6292b0f77410f Mon Sep 17 00:00:00 2001 From: Abimael Martell Date: Wed, 18 Mar 2026 11:49:43 -0700 Subject: [PATCH] fix(postprocess): collapse consecutive spaces in extracted text OCR text layers and some PDF producers emit trailing spaces on each text item, which combine with gap-based joining to produce double spaces ("Vice President"). Now collapses runs of 2+ spaces to single space within lines, preserving leading indentation. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/markdown/postprocess.rs | 35 +++++++++ tests/snapshots/2013-app2.md | 22 +++--- tests/snapshots/nexo-price-en.md | 2 +- tests/snapshots/p1244-1996.md | 18 ++--- tests/snapshots/td9264.md | 116 +++++++++++++++--------------- tests/snapshots/thermo-freon12.md | 8 +-- 6 files changed, 118 insertions(+), 83 deletions(-) diff --git a/src/markdown/postprocess.rs b/src/markdown/postprocess.rs index 2bd9970..6da6090 100644 --- a/src/markdown/postprocess.rs +++ b/src/markdown/postprocess.rs @@ -24,6 +24,12 @@ pub(crate) fn clean_markdown(mut text: String, options: &MarkdownOptions) -> Str text = format_urls(&text); } + // Collapse consecutive spaces within text lines. + // OCR text layers and some PDF producers emit trailing spaces on each + // text item, which combine with gap-based space insertion to produce + // double spaces ("Vice President" instead of "Vice President"). + collapse_consecutive_spaces(&mut text); + // Remove excessive newlines (more than 2 in a row) while text.contains("\n\n\n") { text = text.replace("\n\n\n", "\n\n"); @@ -36,6 +42,35 @@ pub(crate) fn clean_markdown(mut text: String, options: &MarkdownOptions) -> Str text } +/// Collapse runs of 2+ spaces to a single space within each line. +/// Preserves leading indentation and markdown table pipe alignment. +fn collapse_consecutive_spaces(text: &mut String) { + let mut result = String::with_capacity(text.len()); + for line in text.split('\n') { + if !result.is_empty() { + result.push('\n'); + } + // Preserve leading whitespace + let trimmed = line.trim_start(); + let leading = &line[..line.len() - trimmed.len()]; + result.push_str(leading); + // Collapse inner runs of spaces to single space + let mut prev_space = false; + for ch in trimmed.chars() { + if ch == ' ' { + if !prev_space { + result.push(' '); + } + prev_space = true; + } else { + prev_space = false; + result.push(ch); + } + } + } + *text = result; +} + /// Collapse dot leaders (runs of 4+ dots) into " ... " /// Common in tables of contents: "Introduction...............................1" -> "Introduction ... 1" fn collapse_dot_leaders(text: &str) -> String { diff --git a/tests/snapshots/2013-app2.md b/tests/snapshots/2013-app2.md index 0411127..ace09ee 100644 --- a/tests/snapshots/2013-app2.md +++ b/tests/snapshots/2013-app2.md @@ -2,10 +2,10 @@ |---|---|---|---|---|---| ||JAN||||| |1|8/1|Procurement of Criticals Spare Parts for Engine Maintenance on Mahe|PUC|Wartsila Eastern Africa Ltd|Euro97,922.30| -|2|8/1|Procurement of Criticals Spare Parts for Caterpillar Engine on Praslin|PUC|Wartsila Eastern Africa Ltd|Euro270,982.90| +|2|8/1|Procurement of Criticals Spare Parts for Caterpillar Engine on Praslin|PUC|Wartsila Eastern Africa Ltd|Euro270,982.90| |3|15/1|Manufacturing and Deliveries of 900 Students Desks|MOE||SPR Richard, Building & Furniture Contractor Pty LtdSR1,080,000.00| |4|15/1|Renovation Works at Mont Fleuri Secondary School|MOE|Sai-Fu Enterprise|SR2,815,771.00| -|5|15/1|La Gogue to Mont Simpson Raw Water Transfer|PUC|Vijay Construction|SR7,816,058.00| +|5|15/1|La Gogue to Mont Simpson Raw Water Transfer|PUC|Vijay Construction|SR7,816,058.00| |6|15/1|Storm Water Channel Project at Au Cap-Additional Works|DOE|United Concrete Products (Sey)Ltd|SR184,300.00| |7|22/1|Procurement of Security at ex-Maritime Training Centre|SFA|Elite Surveillance Security Agency|SR30,000.00| |8|22/1|Installation of Sewerage Treatment Plant at Anse Gaulette|MLUH|Green Island Construction Compnay|SR4,524,884.85| @@ -18,17 +18,17 @@ |14|5/2|Procurement of Bearings for ABB Turbo Charger|PUC|ABB France|EURO 28,966.15| |15|5/2|Procurement of Alfa Laval Separator Spares|PUC|ALFA LAVAL (Pty) Ltd|Euro 41,191,30| |16|5/2|constraction of 6*2 bedroom Houses- Mont Buxton|MLUH|O-NIVO Construction|SR3,688,844.00| -|17|5/2|Procurement of Critical Spares frr Major Overhaul-Set A41 PUC|PUC|Wartsila Eastern Africa Ltd|EURO 104,880.10| +|17|5/2|Procurement of Critical Spares frr Major Overhaul-Set A41 PUC|PUC|Wartsila Eastern Africa Ltd|EURO 104,880.10| |18|5/2|Procurement of Vehcile x1|MOE|Abhaye Valabhji Pty Ltd|SR 650,000.00| -|19|5/2|Procurement of Vehicle x1|SBFA|Abhaye Valabhji Pty Ltd|SR 585,000.00| +|19|5/2|Procurement of Vehicle x1|SBFA|Abhaye Valabhji Pty Ltd|SR 585,000.00| |20|12/2|Procurement of Turbo charger Rotor for Engine on Praslin|PUC|Marine Power International FZC|Euro 835,669.00| -|21|12/2|Procurement of Critical Spares for Genset M4 Major Overhaul on Praslin|PUC|Overseae Tractor S.A|USD 20,546.12| +|21|12/2|Procurement of Critical Spares for Genset M4 Major Overhaul on Praslin|PUC|Overseae Tractor S.A|USD 20,546.12| |22|12/2|Procurement of Air Cooler Cartridge for Wartsila Engine|PUC|Marine Power International FZC|Euro 36,508.93| |23|12/2|Procurement of Spares for Genset 8P on Praslin|PUC|Wartsila Eastern Africa Ltd|Euro 288,202.50| |24|19/2|Construction of Stone Masonry Retaining Wall at Jean Larue Road, Takamaka|SLTA|Esparon's Enterprise|SR 1,105,069.00| |25|19/2|Procurement of Non Critical Spares for Wartsila Engine at Power Station C- Engine Set A41|PUC|Marine Power International|Euro 144,726.26| |26|19/2|Procurement of Non Critical Spares for Wartsila Engine at Power Station C- Engine Set A31|PUC|Marine Power International FZC|Euro 143,746.75| -|27|19/2|Procurement of Critical Spares for Wartsila Engine-Engine Set B11|PUC|Marine Power International FZC|Euro 44,089.42| +|27|19/2|Procurement of Critical Spares for Wartsila Engine-Engine Set B11|PUC|Marine Power International FZC|Euro 44,089.42| |28|26/2|Procurement for Vehcile x 2|Judiciary|PMC Auto|SR1,349,551.00| |29|26/2|Procurement of Safety Spare Patrs for 8MW Engines - (safety Spares)|PUC|Wartsila Eastern Africa Ltd|Euro 202,898.40| |30|26/2|Procurement of Safety Spare Patrs for 8MW Engines - (Turbo)|PUC|ABB France|Euro 132,833.33| @@ -121,8 +121,8 @@ |94|4/6|Procurement of Cylinder Liner and Pistons|PUC|Wartsila Eastern Africa|Euro 70,082.73| |95|4/6|Procurement of Digital Microwave Equipment|SBC|MOCHINO|Euro 125,845.00| |96|4/6|Procurement of Vehicle 1|LWMA|Abhaye Valabhji Pty Ltd-Jeep|SR 475,000.00| -|96|4/6|Procurement of Vehicle 1|LWMA|EHW Seychelles Ltd- Car|SR 267,850.00| -|97|4/6|Procurement of Forged filter Ball-Valves|PUC|Jainsons Malleables|USD 11,000.00| +|96|4/6|Procurement of Vehicle 1|LWMA|EHW Seychelles Ltd- Car|SR 267,850.00| +|97|4/6|Procurement of Forged filter Ball-Valves|PUC|Jainsons Malleables|USD 11,000.00| |98|11/6|Completion of Stone Masonry Retaining Wall at Jean Larue Road Takamaka|SLTA|Bazil Construction|Sr 1,081,530.00| |99|11/6|Procurement of Seychelles Paswsports|DIA|Groupe Impimerie Nationale|Euro 102,400.00| |100|19/6|Anse Boileau Footpath and Drainage Construction Phase II|SLTA|TCH Building Contractor|SR 960,107.50| @@ -198,7 +198,7 @@ |166|13/8|Procurement of High Pressure pump spares -BZM00003022|PUC|Bluezone Mauritius Ltd|Euro27,712.73| |166|13/8|Procurement of High Pressure pump spares -BZM00003023|PUC|Bluezone Mauritius Ltd|Euro12,639.55| |167|13/8|Procurement of CR64 pump spares|PUC|Bluezone Mauritius Ltd|Euro31,822.00| -|168|13/8|Construction of access road at Ex-Deltel- Anse Royale|MLUH|Benoiton Construction Pty Ltd|SR4,585,441.12| +|168|13/8|Construction of access road at Ex-Deltel- Anse Royale|MLUH|Benoiton Construction Pty Ltd|SR4,585,441.12| |169|13/8|Renovation work to one classroom block at Pionte Larue Secondary School|MOE|Belverdere Builders|SR1,114,575.00| |170|13/8|Completion of Amitie Housing Project 12 x 3 Bedrooms|MLUH|Allied Builders Sey Ltd|6,006,410.37| |171|13/8|Copolia Road widening-Phase 2|SLTA|Belverdere Builders|SR1,037,235.00| @@ -208,7 +208,7 @@ |175|29/8|Servicing of geartrain for Wartsila Engine 18V32LN|PUC|Wartsila Eastern Africa|Euro 21,141.90| |176|29/8|Spare parts for Wartsila Engine 18V32LN|PUC|Wartsila Eastern Africa|Euro38,440.00| |177|29/8|Procurement for sience equipment and chemical for 2013|MOE|Findel Education|GBP37,831.26| -|178|29/8|Installation of fencing at Mont Fleuri Secodary School|MOE|Donald Builbing & Contractor Pty Ltd|SR1,761,034.00| +|178|29/8|Installation of fencing at Mont Fleuri Secodary School|MOE|Donald Builbing & Contractor Pty Ltd|SR1,761,034.00| |179|29/8||Construction ot New Fire Station, fuel store, bin site and boundary wall at Lapasse La Digue-Variations SFRSA|Furui Construction Pty Ltd|SR277,521.45| |180|29/8|Propsed road widening and drainage improvement at Quincy Vilage|SLTA|TCH Contractor|SR1,015,806.24| |181|3/9|Tender for procurement of windows licenses|STB|Victoria Computer Service|SR788,808.00| @@ -237,7 +237,7 @@ |202|1/10|Proposed new traffic lane to 5th June Avenue|SLTA|Divy Constrution|SR2,864,589.00| |203|1/10||Proposed Walkway, Drain, rock armoring , road and Bridge widening at Anse Talbot( Ex-Golden Egg) - Variations SLTA|G & S Enterprise|SR200,448.00| |204|1/10|Proposed Reconstrcution of Burnt House-Au Cap|MLUH|Furui Construction|SR946,130.00| -|205|1/10|Variation on the project associated with the procurement of seven 100m3/day containerised plant|PUC|Tornado Group (UAE)|USD172,500.00| +|205|1/10|Variation on the project associated with the procurement of seven 100m3/day containerised plant|PUC|Tornado Group (UAE)|USD172,500.00| |206|1/10|Works on the breaker system at Bel Omber desalination plant|PUC|United Concrete Products (Sey)Ltd|SR1,998,993.11| |207|1/10|Procurement of Viking Johnson fittings|PUC|Viking Johnson (UK)|GBP92,286.50| |208|1/10|Procurement of HDPE Pipes and Fittings|PUC|STR Marketing Ltee|USD196,672.57| diff --git a/tests/snapshots/nexo-price-en.md b/tests/snapshots/nexo-price-en.md index 9fbc2cd..57c887c 100644 --- a/tests/snapshots/nexo-price-en.md +++ b/tests/snapshots/nexo-price-en.md @@ -6,5 +6,5 @@ |Special|83,500,000 75,909,091(7,590,909) with 3.5% individual consumption tax applied 82,232,000|79,275,000 with 3.5% individual consumption tax applied 79,275,000|upholstered steering wheel(with heating, two-tone color, and Interactive Pixel Lights), LED interior lamp (map lamp, personal lamp, sun visor lamp, and luggage lamp), Metallic door scuff plate • Seat: Synthetic leather seats, 1st-row manual seats, Heated 1st-row seats, 2nd-row 60/40-split folding seats(reclining) • Convenience: Proximity key with push-button start, Smart key remote start, Electronic Parking Brake(with automatic vehicle hold), Paddle shift(regenerative control), Dual-zone full automatic air conditioning(with high-performance antibacterial combination filter, auto defog system, fine dust sensor, air cleaning mode, and after-blow function), 2nd-row seat air vent, Auto light control system, USB Type-C Ports(1×27W switchable charging/data port in 1st-row, and 2×100W charging ports in both 1st and 2nd-row), ECM room mirror(frameless), Rain sensor, Power windows with pinch protection(1st/2nd-row), Power outlet (1 in 1st-row), Parking Distance Warning-Forward/Reverse, Rear View Monitor, Wireless phone charger(single), Walk-away lock, Route planner, Hyundai AI Assistant • Infotainment: 12.3-inch navigation(Bluelink, phone projection, Bluetooth hands-free, and In-car Payment), Audio system(6 speakers), Over-The-Air navigation updates ▶ Standard equipment of Exclusive plus • Smart Safety Technology: Forward Collision-avoidance Assist(intersection crossing/changing lanes in oncoming traffic/approaching from either side/ evasive steering assist), Highway Driving Assist 2, Navigation-based Smart Cruise Control(access road) • Exterior: Roof rack • Interior: Metallic pedal, Driving mode-dependent ambient mood lighting(crash pad, 1st/2nd-row door trim) • Seat: Synthetic leather seats(patch applied), Power-adjustable driver's|▶ [600,000] Built-in Cam 2 Plus, Augmented reality navigation ▶ [850,000] Indoor/outdoor V2L ▶ [950,000] Parking Assist ▶ [1,150,000] Audio by BANG & OLUFSEN| |Prestige|87,893,000 79,902,727(7,990,273) with 3.5% individual consumption tax applied 86,559,000|83,445,000 with 3.5% individual consumption tax applied 83,445,000|seat(8-way, lumbar support, and Integrated Memory System(driver's seat and outside mirror connected)), Power-adjustable front passenger’s seat(8-way), Ventilated 1st-row seats, Heated 2nd-row seats • Convenience: Hi-pass(e hi-pass), In-car fingerprint authentication system(personalization, startup, payment, and etc.), Smart power tailgate ▶ Standard equipment of Exclusive Special plus • Smart Safety Technology: Remote Smart Parking Assist 2, Parking Collison- avoidance Assist(front/side/rear) • Exterior: Intelligent Front-Lighting System(IFS), Dynamic welcome/escort lighting(1 type), Sequential turn signals(fron t and rear), Ambient lighting auto flush door handles, Two-tone door garnish, Glossy black rear diffuser • Interior: Recycled PET suede interior materials(headlining/sunvisor), Fabric upholstered crash pad • Seat: BIO-processed natural leather seats(metal patch applied, embossed design punching), Passenger's seat walk-in device, 1st-row relaxation comfort seats(leg rest included), Ventilated 2nd-row seats • Convenience: Parking Distance Warning-Side, Head-Up Display, Digital key 2, Wireless phone charger(dual), Surround View Monitor, Blind-spot View Monitor, LED reverse light guide • Infotainment: Audio by BANG & OLUFSEN sound system(14 speakers, including external amp), Active road noise control, Active Sound Design|sound system ▶ [250,000] 19-inch alloy wheels & tires ▶ [600,000] Built-in Cam 2 Plus, Augmented reality navigation ▶ [850,000] Indoor/outdoor V2L ▶ [900,000] Vision roof ▶ [1,380,000] Digital side mirror ▶ [750,000] Camera package ▶ [250,000] 19-inch alloy wheels & tires| -**Classification Details** **Indoor/outdoor V2L** Indoor V2L, Outdoor V2L(connectorless type) **Parking Assist** Surround View Monitor, Blind-spot View Monitor, Parking Distance Warning-Side, Parking Collison-avoidance Assist-Rear **Audio by BANG & OLUFSEN** Audio by BANG & OLUFSEN sound system(14 speakers, including external amp.), Active road noise control, Active Sound Design **sound system** **Camera package** Digital center mirror(with camera sensor cleaning system), Driver monitoring system THE ALL-NEW NEXO /// ECO-FRIENDLY CAR +**Classification Details** **Indoor/outdoor V2L** Indoor V2L, Outdoor V2L(connectorless type) **Parking Assist** Surround View Monitor, Blind-spot View Monitor, Parking Distance Warning-Side, Parking Collison-avoidance Assist-Rear **Audio by BANG & OLUFSEN** Audio by BANG & OLUFSEN sound system(14 speakers, including external amp.), Active road noise control, Active Sound Design **sound system** **Camera package** Digital center mirror(with camera sensor cleaning system), Driver monitoring system THE ALL-NEW NEXO /// ECO-FRIENDLY CAR diff --git a/tests/snapshots/p1244-1996.md b/tests/snapshots/p1244-1996.md index a80af44..4548660 100644 --- a/tests/snapshots/p1244-1996.md +++ b/tests/snapshots/p1244-1996.md @@ -8,7 +8,7 @@ Department of the Treasury **Internal Revenue Service** # and Report to Employer -**This publication contains:** **Form 4070A, Employee’s Daily Record of** Tips **Form 4070, Employee’s Report of Tips to** Employer +**This publication contains:** **Form 4070A, Employee’s Daily Record of** Tips **Form 4070, Employee’s Report of Tips to** Employer For the period @@ -20,7 +20,7 @@ Name and address of employee **Publication 1244 (Rev. 7-96)** Cat. No. 44472W -**Instructions** You must keep sufficient proof to show the amount of your tip income for the year. A daily record of your tip income is considered sufficient proof. Keep a daily record for each workday showing the amount of cash and credit card tips received directly from customers or other employees. Also keep a record of the amount of tips, if any, you paid to other employees through tip sharing, tip pooling or other arrangements, and the names of employees to whom you paid tips. Show the date that each entry is made. This date should be on or near the date you received the tip income. You may use Form 4070A , Employee’s Daily Record of Tips, or any other daily record to record your tips. **Reporting Tips to Your Employer.— If you** receive tips that total $20 or more for any month while working for one employer, you must report the tips to your employer. Tips include cash left by customers, tips customers add to credit card charges, and tips you receive from other employees. You must report your tips for any one month by the 10th day of the next month. If the 10th day falls on a Saturday, Sunday, or legal holiday, you may give the report to your employer on the next business day that is not a Saturday, Sunday, or legal holiday. You must report tips that total $20 or more every month regardless of your total wages and tips for the year. You may use Form 4070, Employee’s Report of Tips to Employer, to report your tips to your employer. See the instructions on the back of Form 4070. You must include all tips, including tips not reported to your employer, as wages on your income tax return. You may use the last page of this publication to total your tips for the year. Your employer must withhold income, social security, and Medicare (or railroad retirement) taxes on tips you report. Your employer usually deducts the withholding due on tips from your regular wages. +**Instructions** You must keep sufficient proof to show the amount of your tip income for the year. A daily record of your tip income is considered sufficient proof. Keep a daily record for each workday showing the amount of cash and credit card tips received directly from customers or other employees. Also keep a record of the amount of tips, if any, you paid to other employees through tip sharing, tip pooling or other arrangements, and the names of employees to whom you paid tips. Show the date that each entry is made. This date should be on or near the date you received the tip income. You may use Form 4070A , Employee’s Daily Record of Tips, or any other daily record to record your tips. **Reporting Tips to Your Employer.— If you** receive tips that total $20 or more for any month while working for one employer, you must report the tips to your employer. Tips include cash left by customers, tips customers add to credit card charges, and tips you receive from other employees. You must report your tips for any one month by the 10th day of the next month. If the 10th day falls on a Saturday, Sunday, or legal holiday, you may give the report to your employer on the next business day that is not a Saturday, Sunday, or legal holiday. You must report tips that total $20 or more every month regardless of your total wages and tips for the year. You may use Form 4070, Employee’s Report of Tips to Employer, to report your tips to your employer. See the instructions on the back of Form 4070. You must include all tips, including tips not reported to your employer, as wages on your income tax return. You may use the last page of this publication to total your tips for the year. Your employer must withhold income, social security, and Medicare (or railroad retirement) taxes on tips you report. Your employer usually deducts the withholding due on tips from your regular wages. *(continued on inside of back cover)* @@ -43,9 +43,9 @@ tips of directly from customers received other employees paid tips rec’d. entr 27 28 29 30 31 **Subtotals** **from pages** **1, 2, and 3** **Totals** -**1.** Report total cash tips (col. a) on Form 4070, line 1. -**2.** Report total credit card tips (col. b) on Form 4070, line 2. -**3.** Report total tips paid out (col. c) on Form 4070, line 3. **Page 4** +**1.** Report total cash tips (col. a) on Form 4070, line 1. +**2.** Report total credit card tips (col. b) on Form 4070, line 2. +**3.** Report total tips paid out (col. c) on Form 4070, line 3. **Page 4** Form Employee’s Report (Rev. July 1996) @@ -59,15 +59,15 @@ Employer’s name and address (include establishment name, if different) **1** C **3** Tips paid out -Month or shorter period in which tips were received **4** Net tips (lines 1 + 2 - 3 ) from, 19, to, 19 Signature Date +Month or shorter period in which tips were received **4** Net tips (lines 1 + 2 - 3 ) from, 19, to, 19 Signature Date -**Paperwork Reduction Act Notice.— We ask for the** information on these forms to carry out the Internal Revenue laws of the United States. You are required to give us the information. We need it to ensure that you are complying with these laws and to allow us to figure and collect the right amount of tax. You are not required to provide the information requested on a form that is subject to the Paperwork Reduction Act unless the form displays a valid OMB control number. Books or records relating to a form or its instructions must be retained as long as their contents may become material in the administration of any Internal Revenue law. Generally, tax returns and return information are confidential, as required by Code section 6103. The time needed to complete Forms 4070 and 4070A will vary depending on individual circumstances. The estimated average times are: Recordkeeping—Form 4070, 7 min.; Form 4070A, 3 hr. and 23 min.; **Learning** **about the law —each form, 2 min.; Preparing Form 4070,** 13 min.; Form 4070A, 55 min.; and Copying and **providing Form 4070, 10 min.; Form 4070A, 14 min.** If you have comments concerning the accuracy of these time estimates or suggestions for making these +**Paperwork Reduction Act Notice.— We ask for the** information on these forms to carry out the Internal Revenue laws of the United States. You are required to give us the information. We need it to ensure that you are complying with these laws and to allow us to figure and collect the right amount of tax. You are not required to provide the information requested on a form that is subject to the Paperwork Reduction Act unless the form displays a valid OMB control number. Books or records relating to a form or its instructions must be retained as long as their contents may become material in the administration of any Internal Revenue law. Generally, tax returns and return information are confidential, as required by Code section 6103. The time needed to complete Forms 4070 and 4070A will vary depending on individual circumstances. The estimated average times are: Recordkeeping—Form 4070, 7 min.; Form 4070A, 3 hr. and 23 min.; **Learning** **about the law —each form, 2 min.; Preparing Form 4070,** 13 min.; Form 4070A, 55 min.; and Copying and **providing Form 4070, 10 min.; Form 4070A, 14 min.** If you have comments concerning the accuracy of these time estimates or suggestions for making these -forms simpler, we would be happy to hear from you. You can write to the Tax Forms Committee, Western Area Distribution Center, Rancho Cordova, CA 95743-0001. **Purpose.—Use this form to report tips you receive to** your employer. This includes cash tips, tips you receive from other employees, and credit card tips. You must report tips every month regardless of your total wages and tips for the year. However, you do not have to report tips to your employer for any month you received less than $20 in tips while working for that employer. Report tips by the 10th day of the month following the month that you receive them. If the 10th day is a Saturday, Sunday, or legal holiday, report tips by the next day that is not a Saturday, Sunday, or legal holiday. See Pub. 531, Reporting Tip Income, for more information. You can get additional copies of Pub. 1244, Employee’s Daily Record of Tips and Report to Employer, which contains both Forms 4070A and 4070, by calling 1-800-TAX-FORM (1-800-829-3676). +forms simpler, we would be happy to hear from you. You can write to the Tax Forms Committee, Western Area Distribution Center, Rancho Cordova, CA 95743-0001. **Purpose.—Use this form to report tips you receive to** your employer. This includes cash tips, tips you receive from other employees, and credit card tips. You must report tips every month regardless of your total wages and tips for the year. However, you do not have to report tips to your employer for any month you received less than $20 in tips while working for that employer. Report tips by the 10th day of the month following the month that you receive them. If the 10th day is a Saturday, Sunday, or legal holiday, report tips by the next day that is not a Saturday, Sunday, or legal holiday. See Pub. 531, Reporting Tip Income, for more information. You can get additional copies of Pub. 1244, Employee’s Daily Record of Tips and Report to Employer, which contains both Forms 4070A and 4070, by calling 1-800-TAX-FORM (1-800-829-3676). **Instructions (continued)** -**Unreported Tips.—If you received tips of $20 or** more for any month while working for one employer but did not report them to your employer, you must figure and pay social security and Medicare taxes on the unreported tips when you file your tax return. If you have unreported tips, you must use Form 1040 and Form 4137, Social Security and Medicare Tax on Unreported Tip Income, to report them. You may not use Form 1040A or 1040EZ. Employees subject to the Railroad Retirement Tax Act cannot use Form 4137 to pay railroad retirement tax on unreported tips. To get railroad retirement credit, you must report tips to your employer. If you do not report tips to your employer as required, you may be charged a penalty of 50% of the social security and Medicare taxes (or railroad retirement tax) due on the unreported tips unless there was reasonable cause for not reporting them. **Additional Information.—Get Pub. 531, Reporting** Tip Income, and Form 4137 for more information on tips. If you are an employee of certain large food or beverage establishments, see Pub. 531 for tip allocation rules. **Recordkeeping.—If you do not keep a daily** record of tips, you must keep other reliable proof of the tip income you received. This proof includes copies of restaurant bills and credit card charges that show amounts customers added as tips. Keep your tip income records for as long as the information on them may be needed in the administration of any Internal Revenue law. +**Unreported Tips.—If you received tips of $20 or** more for any month while working for one employer but did not report them to your employer, you must figure and pay social security and Medicare taxes on the unreported tips when you file your tax return. If you have unreported tips, you must use Form 1040 and Form 4137, Social Security and Medicare Tax on Unreported Tip Income, to report them. You may not use Form 1040A or 1040EZ. Employees subject to the Railroad Retirement Tax Act cannot use Form 4137 to pay railroad retirement tax on unreported tips. To get railroad retirement credit, you must report tips to your employer. If you do not report tips to your employer as required, you may be charged a penalty of 50% of the social security and Medicare taxes (or railroad retirement tax) due on the unreported tips unless there was reasonable cause for not reporting them. **Additional Information.—Get Pub. 531, Reporting** Tip Income, and Form 4137 for more information on tips. If you are an employee of certain large food or beverage establishments, see Pub. 531 for tip allocation rules. **Recordkeeping.—If you do not keep a daily** record of tips, you must keep other reliable proof of the tip income you received. This proof includes copies of restaurant bills and credit card charges that show amounts customers added as tips. Keep your tip income records for as long as the information on them may be needed in the administration of any Internal Revenue law. **Instructions (continued)** diff --git a/tests/snapshots/td9264.md b/tests/snapshots/td9264.md index d1b5abf..f53d803 100644 --- a/tests/snapshots/td9264.md +++ b/tests/snapshots/td9264.md @@ -1,71 +1,71 @@ -(e) [Reserved]. For further guidance, see §1.1563-3T(e)(1). Par. 50. Section 1.1563-3T is added to read as follows: +(e) [Reserved]. For further guidance, see §1.1563-3T(e)(1). Par. 50. Section 1.1563-3T is added to read as follows: §1.1563-3T Rules for determining stock ownership (temporary). -(a) through (d)(2)(iii) [Reserved]. For further guidance, see §1.1563-3(a) -through (d)(2)(iii). (iv) Statement. If the application of paragraph (d)(2)(ii) or (iii) of §1.1563-3 does not result in a corporation being treated as a component member of only one controlled group of corporations on a December 31, then such corporation will be treated as a component member of only one such group on such date. Such corporation may elect the group in which it is to be included by including on or with its income tax return a statement entitled, “STATEMENT TO ELECT CONTROLLED GROUP PURSUANT TO §1.1563-3T(d)(2)(iv).” The statement must include-- +(a) through (d)(2)(iii) [Reserved]. For further guidance, see §1.1563-3(a) +through (d)(2)(iii). (iv) Statement. If the application of paragraph (d)(2)(ii) or (iii) of §1.1563-3 does not result in a corporation being treated as a component member of only one controlled group of corporations on a December 31, then such corporation will be treated as a component member of only one such group on such date. Such corporation may elect the group in which it is to be included by including on or with its income tax return a statement entitled, “STATEMENT TO ELECT CONTROLLED GROUP PURSUANT TO §1.1563-3T(d)(2)(iv).” The statement must include-- (A) A description of each of the controlled groups in which the corporation -could be included. The description must include the name and employer identification number of each component member of each such group and the stock ownership of the component members of each such group; and +could be included. The description must include the name and employer identification number of each component member of each such group and the stock ownership of the component members of each such group; and (B) The following representation: [INSERT NAME AND EMPLOYER IDENTIFICATION NUMBER OF CORPORATION] ELECTS TO BE TREATED AS A COMPONENT MEMBER OF THE [INSERT DESIGNATION OF GROUP]. -(v) Election-- (A) Election filed. An election filed under paragraph (d)(2)(iv) of +(v) Election-- (A) Election filed. An election filed under paragraph (d)(2)(iv) of this section is irrevocable and effective until paragraph (d)(2)(ii) or (iii) of §1.1563-3 applies or until a change in the stock ownership of the corporation results in termination of membership in the controlled group in which such corporation has been included. (B) Election not filed. In the event no election is filed in accordance with the -provisions of paragraph (d)(2)(iv) of this section, then the Internal Revenue Service will determine the group in which such corporation is to be included. Such determination will be binding for all subsequent years unless the corporation files a valid election with respect to any such subsequent year or until a change in the stock ownership of the corporation results in termination of membership in the controlled group in which such corporation has been included. +provisions of paragraph (d)(2)(iv) of this section, then the Internal Revenue Service will determine the group in which such corporation is to be included. Such determination will be binding for all subsequent years unless the corporation files a valid election with respect to any such subsequent year or until a change in the stock ownership of the corporation results in termination of membership in the controlled group in which such corporation has been included. -(d)(3) [Reserved]. For further guidance, see §1.1563-3(d)(3). +(d)(3) [Reserved]. For further guidance, see §1.1563-3(d)(3). (e) Effective date-- (1) Applicability date. This section applies to any original Federal income tax return (including any amended return filed on or before the due date (including extensions) of such original return) timely filed on or after May 30, 2006. -(2) Expiration date. The applicability of this section will expire on May 26, -2009. Par. 51. Section 1.6012-2 is amended by revising paragraph (c) and adding paragraph (k) to read as follows: §1.6012-2 Corporations required to make returns of income. +(2) Expiration date. The applicability of this section will expire on May 26, +2009. Par. 51. Section 1.6012-2 is amended by revising paragraph (c) and adding paragraph (k) to read as follows: §1.6012-2 Corporations required to make returns of income. * * * * * (c) [Reserved]. For further guidance, see §1.6012-2T(c). * * * * * -(k) [Reserved]. For further guidance, see §1.6012-2T(k)(1). +(k) [Reserved]. For further guidance, see §1.6012-2T(k)(1). -Par. 52. Section 1.6012-2T is added to read as follows: §1.6012-2T Corporations required to make returns of income (temporary). +Par. 52. Section 1.6012-2T is added to read as follows: §1.6012-2T Corporations required to make returns of income (temporary). -(a) through (b) [Reserved]. For further guidance, see §1.6012-2(a) through +(a) through (b) [Reserved]. For further guidance, see §1.6012-2(a) through (b). -(c) Insurance companies-- (1) Domestic life insurance companies-- (i) In -general. A life insurance company subject to tax under section 801 shall make a return on Form 1120L. Except as provided in paragraph (c)(4) of this section, such company shall file with its return-- +(c) Insurance companies-- (1) Domestic life insurance companies-- (i) In +general. A life insurance company subject to tax under section 801 shall make a return on Form 1120L. Except as provided in paragraph (c)(4) of this section, such company shall file with its return-- (A) A copy of its annual statement which shows the reserves used by the company in computing the taxable income reported on its return; and (B) A copy of Schedule A (real estate) and of Schedule D (bonds and stocks), -or any successor thereto, of such annual statement. (ii) Mutual savings banks. Mutual savings banks conducting life insurance business and meeting the requirements of section 594 are subject to partial tax computed on Form 1120 and partial tax computed on Form 1120L. The Form 1120L is attached as a schedule to Form 1120, together with the annual statement and schedules required to be filed with Form 1120L. +or any successor thereto, of such annual statement. (ii) Mutual savings banks. Mutual savings banks conducting life insurance business and meeting the requirements of section 594 are subject to partial tax computed on Form 1120 and partial tax computed on Form 1120L. The Form 1120L is attached as a schedule to Form 1120, together with the annual statement and schedules required to be filed with Form 1120L. -(2) Domestic nonlife insurance companies. Every domestic insurance -company other than a life insurance company shall make a return on Form 1120PC. This includes organizations described in section 501(m)(1) that provide commercial- type insurance and organizations described in section 833. Except as provided in paragraph (c)(4) of this section, such company shall file with its return a copy of its +(2) Domestic nonlife insurance companies. Every domestic insurance +company other than a life insurance company shall make a return on Form 1120PC. This includes organizations described in section 501(m)(1) that provide commercial- type insurance and organizations described in section 833. Except as provided in paragraph (c)(4) of this section, such company shall file with its return a copy of its annual statement (or a pro forma annual statement), including the underwriting and investment exhibit for the year covered by such return. -(3) Foreign insurance companies. The provisions of paragraphs (c)(1) and +(3) Foreign insurance companies. The provisions of paragraphs (c)(1) and (c)(2) of this section concerning the returns and statements of insurance companies subject to tax under section 801 or section 831 also apply to foreign insurance companies subject to tax under those sections, except that the copy of the annual statement required to be submitted with the return shall, in the case of a foreign insurance company that is not required to file an annual statement, be a copy of the pro forma annual statement relating to the United States business of such company. (4) Exception for insurance companies filing their Federal income tax returns -electronically. If an insurance company described in paragraph (c)(1), (c)(2), or +electronically. If an insurance company described in paragraph (c)(1), (c)(2), or -(c)(3) of this section files its Federal income tax return electronically, it should not include on or with such return its annual statement (or pro forma annual statement), or any portion thereof. Such statement must be available at all times for inspection by authorized Internal Revenue Service officers or employees and retained for so long as such statements may be material in the administration of any internal revenue law. See §1.6001-1(e). -(5) Definition. For purposes of this section, the term annual statement means +(c)(3) of this section files its Federal income tax return electronically, it should not include on or with such return its annual statement (or pro forma annual statement), or any portion thereof. Such statement must be available at all times for inspection by authorized Internal Revenue Service officers or employees and retained for so long as such statements may be material in the administration of any internal revenue law. See §1.6001-1(e). +(5) Definition. For purposes of this section, the term annual statement means the annual statement, the form of which is approved by the National Association of Insurance Commissioners (NAIC), which is filed by an insurance company for the year with the insurance departments of States, Territories, and the District of -Columbia. The term annual statement also includes a pro forma annual statement if the insurance company is not required to file the NAIC annual statement. +Columbia. The term annual statement also includes a pro forma annual statement if the insurance company is not required to file the NAIC annual statement. -(d) through (j) [Reserved]. For further guidance, see §1.6012-2(d) through (j). +(d) through (j) [Reserved]. For further guidance, see §1.6012-2(d) through (j). (k) Effective date-- (1) Applicability date. This section applies to any original Federal income tax return (including any amended return filed on or before the due date (including extensions) of such original return) timely filed on or after May 30, 2006. -(2) Expiration date. The applicability of this section will expire on May 26, -2009. Par. 53. For each entry in the “Location” column of the following table, remove the language in the “Remove” column and add the language in the “Add” column in its place: Location Remove Add The last sentence of the The following rules shall The rules described in introductory text to be applicable in paragraph (a) of §1.302- §1.302-4 determining whether the 4T and in paragraphs (b) +(2) Expiration date. The applicability of this section will expire on May 26, +2009. Par. 53. For each entry in the “Location” column of the following table, remove the language in the “Remove” column and add the language in the “Add” column in its place: Location Remove Add The last sentence of the The following rules shall The rules described in introductory text to be applicable in paragraph (a) of §1.302- §1.302-4 determining whether the 4T and in paragraphs (b) specific requirements of through (g) of this section section 302(c)(2) are apply in determining met: whether the specific requirements of section 302(c)(2) are met. §1.338(h)(10)-1(f) §1.331-1(d), and §1.332-§1.331-1T(d) and §1.332- 6 6T |The last sentence of|paragraph (a)(2)(ii) of this|paragraph (a) of §1.382-| @@ -178,9 +178,9 @@ paragraphs (d)(2)(ii) and (iii) of this section, and paragraph (d)(2)(iv) of §1 (d) through (j) of §1.6012- 2, and paragraph (c) of §1.6012-2T -PART 602--OMB CONTROL NUMBERS UNDER THE PAPERWORK REDUCTION ACT Par. 54. The authority citation for part 602 continues to read as follows: Authority: 26 U.S.C. 7805. Par. 55. In §602.101, paragraph (b) is amended to read as follows: +PART 602--OMB CONTROL NUMBERS UNDER THE PAPERWORK REDUCTION ACT Par. 54. The authority citation for part 602 continues to read as follows: Authority: 26 U.S.C. 7805. Par. 55. In §602.101, paragraph (b) is amended to read as follows: -1. The following entries to the table are removed: +1. The following entries to the table are removed: §602.101 OMB Control numbers. * * * * * @@ -188,14 +188,14 @@ PART 602--OMB CONTROL NUMBERS UNDER THE PAPERWORK REDUCTION ACT Par. 54. The au CFR part or section where Current OMB identified or described control No. * * * * * -1.332-6…………………………………………………………………. 1545-2019 -1.382-11……………………………………………………………….. 1545-2019 -1.351-3…………………………………………………………………. 1545-2019 -1.355-5…………………………………………………………………. 1545-2019 -1.368-3…………………………………………………………………. 1545-2019 -1.1081-11………………………………………………………………. 1545-2019 +1.332-6…………………………………………………………………. 1545-2019 +1.382-11……………………………………………………………….. 1545-2019 +1.351-3…………………………………………………………………. 1545-2019 +1.355-5…………………………………………………………………. 1545-2019 +1.368-3…………………………………………………………………. 1545-2019 +1.1081-11………………………………………………………………. 1545-2019 * * * * * **______________________________________________________________** -2. The following entries are added in numerical order to the table: +2. The following entries are added in numerical order to the table: §602.101 OMB Control numbers. * * * * * @@ -203,33 +203,33 @@ CFR part or section where Current OMB identified or described control No. CFR part or section where Current OMB identified or described control No. * * * * * -1.302-2T………………………………………………………………… 1545-2019 -1.302-4T………………………………………………………………… 1545-2019 +1.302-2T………………………………………………………………… 1545-2019 +1.302-4T………………………………………………………………… 1545-2019 -1.331-1T………………………………………………………………… 1545-2019 -1.332-6T………………………………………………………………... 1545-2019 -1.338-10T………………………………………………………………. 1545-2019 -1.351-3T………………………………………………………………… 1545-2019 -1.355-5T………………………………………………………………… 1545-2019 -1.368-3T………………………………………………………………… 1545-2019 -1.381(b)-1T…………………………………………………………….. 1545-2019 -1.382-8T………………………………………………………………… 1545-2019 -1.382-11T………………………………………………………………. 1545-2019 -1.1081-11T……………………………………………………………… 1545-2019 -1.1221-2T……………………………………………………………….. 1545-2019 -1.1502-13T……………………………………………………………… 1545-2019 -1.1502-31T……………………………………………………………… 1545-2019 -1.1502-32T……………………………………………………………… 1545-2019 -1.1502-33T……………………………………………………………… 1545-2019 -1.1502-35T……………………………………………………………… 1545-2019 -1.1502-76T……………………………………………………………… 1545-2019 -1.1502-95T……………………………………………………………… 1545-2019 -1.1563-1T……………………………………………………………….. 1545-2019 +1.331-1T………………………………………………………………… 1545-2019 +1.332-6T………………………………………………………………... 1545-2019 +1.338-10T………………………………………………………………. 1545-2019 +1.351-3T………………………………………………………………… 1545-2019 +1.355-5T………………………………………………………………… 1545-2019 +1.368-3T………………………………………………………………… 1545-2019 +1.381(b)-1T…………………………………………………………….. 1545-2019 +1.382-8T………………………………………………………………… 1545-2019 +1.382-11T………………………………………………………………. 1545-2019 +1.1081-11T……………………………………………………………… 1545-2019 +1.1221-2T……………………………………………………………….. 1545-2019 +1.1502-13T……………………………………………………………… 1545-2019 +1.1502-31T……………………………………………………………… 1545-2019 +1.1502-32T……………………………………………………………… 1545-2019 +1.1502-33T……………………………………………………………… 1545-2019 +1.1502-35T……………………………………………………………… 1545-2019 +1.1502-76T……………………………………………………………… 1545-2019 +1.1502-95T……………………………………………………………… 1545-2019 +1.1563-1T……………………………………………………………….. 1545-2019 -1.1563-3T……………………………………………………………….. 1545-2019 -1.6012-2T……………………………………………………………….. 1545-2019 +1.1563-3T……………………………………………………………….. 1545-2019 +1.6012-2T……………………………………………………………….. 1545-2019 * * * * * Mark E. Matthews Deputy Commissioner for Services and Enforcement. -Approved: May 19, 2006 Eric Solomon Acting Deputy Assistant Secretary of the Treasury (Tax Policy). +Approved: May 19, 2006 Eric Solomon Acting Deputy Assistant Secretary of the Treasury (Tax Policy). diff --git a/tests/snapshots/thermo-freon12.md b/tests/snapshots/thermo-freon12.md index ffaf571..08a217a 100644 --- a/tests/snapshots/thermo-freon12.md +++ b/tests/snapshots/thermo-freon12.md @@ -1,6 +1,6 @@ **Technical Information** -## l T-12 SI +## l T-12 SI DuPont Fluorochemicals @@ -16,10 +16,10 @@ DuPont Fluorochemicals **®** **Thermodynamic Properties of Freon 12 Refrigerant** **(R-12)** **SI Units** -Tables of the thermodynamic **Units** properties of R-12 have been developed and are presented here. P = Pressure in kPa. Absolute This information is based on values calculated using the NIST REFPROP T = Temperature in Celcius Database (McLinden, M.O., Klein, +Tables of the thermodynamic **Units** properties of R-12 have been developed and are presented here. P = Pressure in kPa. Absolute This information is based on values calculated using the NIST REFPROP T = Temperature in Celcius Database (McLinden, M.O., Klein, -S.A., Lemmon, E.W., and Peskin, Vf = Fluid (liquid) specific volume -A.P., NIST Standard Reference in cubic meters per kilogram Database 23, NIST thermodynamic and transport properties of Vg = Vapour (gas) specific volume refrigerants and refrigerant in cubic meters per kilogram mixtures – REFPROP version 6.01, Standard Reference Data Program, df and dg = Fluid and Vapour National Institute of Standards and (respectively) densities in Technology, 1998). kilograms per cubic meter +S.A., Lemmon, E.W., and Peskin, Vf = Fluid (liquid) specific volume +A.P., NIST Standard Reference in cubic meters per kilogram Database 23, NIST thermodynamic and transport properties of Vg = Vapour (gas) specific volume refrigerants and refrigerant in cubic meters per kilogram mixtures – REFPROP version 6.01, Standard Reference Data Program, df and dg = Fluid and Vapour National Institute of Standards and (respectively) densities in Technology, 1998). kilograms per cubic meter H = Enthalpy (kJ/kg) S = Entropy (kJ/kg.K)