Skip to main content

Diffs arbitrary HTML inline.

Project description

htmldiff2

htmldiff2 is a library that uses difflib, genshi and html5lib to diff arbitrary fragments of HTML inline. htmldiff2 is a friendly fork of Armin Ronacher's htmldiff which needed to be upgraded for the diffengine project. See this issue for context.

>>> from htmldiff2 import render_html_diff
>>> render_html_diff('Foo <b>bar</b> baz', 'Foo <i>bar</i> baz')
u'<div class="diff">Foo <i class="tagdiff_replaced">bar</i> baz</div>'
>>> render_html_diff('Foo bar baz', 'Foo baz')
u'<div class="diff">Foo <del>bar</del> baz</div>'
>>> render_html_diff('Foo baz', 'Foo blah baz')
u'<div class="diff">Foo <ins>blah</ins> baz</div>'

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

htmldiff2-0.1.1.tar.gz (4.3 kB view details)

Uploaded Source

File details

Details for the file htmldiff2-0.1.1.tar.gz.

File metadata

  • Download URL: htmldiff2-0.1.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/42.0.2 requests-toolbelt/0.8.0 tqdm/4.28.0 CPython/3.7.6

File hashes

Hashes for htmldiff2-0.1.1.tar.gz
Algorithm Hash digest
SHA256 232b73ab22a7651765703a96a9a01fb4dce43a607204c8ad6d9a9171c20043e4
MD5 72a6d0b39cb08ab4208672bc69097dec
BLAKE2b-256 19fe91eecae1e359e82f92901d59ad51c7a0b251ae8cb3c8c9223b0dd74f992c

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