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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file prettierfier-1.0.0.tar.gz.

File metadata

  • Download URL: prettierfier-1.0.0.tar.gz
  • Upload date:
  • Size: 1.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.2

File hashes

Hashes for prettierfier-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f07e694827eb608f6f4771a1578de2c969df05526a98aa53e29b3372c6453858
MD5 9c6f28ced87fd9d13463741a2e4fe8f8
BLAKE2b-256 169f051ed232559135de2f8c0a1ef7edc6631ecb87a0845084210a9d9bee2c1a

See more details on using hashes here.

File details

Details for the file prettierfier-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: prettierfier-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 2.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.2

File hashes

Hashes for prettierfier-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 55dd324265760c6eec5a9ce03a108a0b781dc8926b9504c39065dfaf8d85f75e
MD5 4a61626d0da90a976b9181d1ef4d949f
BLAKE2b-256 42d8bece32847c67ea0f562cc5ea017ec73848f445c788810b86ccc2b91d563c

See more details on using hashes here.

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