Skip to main content

Intelligently pretty-print HTML/XML with inline tags.

Project description

prettierfier

While I love Beautiful Soup, the BeautifulSoup.prettify() function adds a linebreak between every tag. This results in unwanted white space between tags that should be inline, like <sup>, <a>, <span>, etc:

<p>Introducing GitHub<sup>&reg;</sup></p>

Introducing GitHub®

vs.

<p>
    Introducing GitHub
    <sup>
        &reg;
    </sup>
</p>

Introducing GitHub ®

This script parses HTML/XML as a raw string to more intelligently format tags.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prettierfier-1.0.0.tar.gz (1.3 kB view hashes)

Uploaded Source

Built Distribution

prettierfier-1.0.0-py3-none-any.whl (2.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page