whitespace-handling

Configures whitespace modes, newline styles, and list indentation during HTML to Markdown conversion.

836|66|Updated Feb 3, 2025
One-click install
npx skills add https://github.com/kreuzberg-dev/html-to-markdown --skill whitespace-handling
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: whitespace-handling
Source: https://github.com/kreuzberg-dev/html-to-markdown/tree/main/.codex/skills/whitespace-handling
Command: npx skills add https://github.com/kreuzberg-dev/html-to-markdown --skill whitespace-handling

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides fine-grained control over how whitespace (spaces, newlines, tabs) is handled during the conversion of HTML to Markdown, ensuring accurate representation of content.

Core Features & Use Cases

  • Whitespace Modes: Choose between Normalized (collapses multiple spaces/newlines) and Strict (preserves all whitespace exactly).
  • Newline Styles: Configure how <br> tags are converted (e.g., two spaces or backslash).
  • List Indentation: Control whether nested lists use spaces or tabs for indentation.
  • Use Case: Convert a poem from HTML to Markdown, preserving its exact line breaks and spacing using Strict mode, or clean up messy web content with Normalized mode.

Quick Start

Convert the provided HTML content to Markdown, preserving all original whitespace.

Frequently Asked Questions about whitespace-handling

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I preserve exact line breaks and spacing when converting HTML to Markdown?

To preserve exact line breaks and spacing during HTML to Markdown conversion, use the Strict whitespace mode. This mode retains all original spaces and newlines exactly as they appear in the HTML source without collapsing them.

What is the best way to clean up messy web content during HTML to Markdown conversion?

The best way to clean up messy web content is using the Normalized whitespace mode for HTML to Markdown conversion. This mode collapses multiple spaces and newlines, cleaning up the text rendering for a consistent output.

Can I configure how br tags are converted to Markdown line breaks?

Yes, you can configure how br tags are converted to Markdown line breaks by selecting specific newline styles. You can choose to render line breaks using either two spaces or a backslash at the end of the line.

How do I control list indentation with spaces or tabs in Markdown output?

You control list indentation in Markdown output by configuring the list indentation settings. This allows you to specify whether nested lists use spaces or tabs for their indentation structure.

Why does my Markdown output have inconsistent text rendering after converting from HTML?

Inconsistent text rendering in Markdown output usually occurs because the whitespace handling mode is not configured correctly. Choosing Strict mode preserves original formatting, while Normalized mode collapses extra spaces and newlines.

Does HTML to Markdown conversion support preserving whitespace for poems or code blocks?

Yes, HTML to Markdown conversion supports preserving whitespace for poems or code blocks. By applying the Strict whitespace mode, the conversion ensures that exact line breaks and original spacing are maintained in the final text.