Skip to main content

nti.contentfragments

Latest release Supported Python versions https://github.com/NextThought/nti.contentfragments/workflows/tests/badge.svg https://coveralls.io/repos/github/NextThought/nti.contentfragments/badge.svg Documentation Status

Support for working with string-based content in a Zope3/ZTK environment.

Overview

In a client/server environment dealing with various types of content from users, it’s important to know what not just the Python type of a particular string is, but also what the semantic type of the string is: HTML, plain text, LaTeX, etc.

This package defines interfaces and classes to be able to record this information. It also features a framework for transforming between the various supported semantic types (e.g., HTML to plain text).

Other features:

  • Support for making arbitrary incoming HTML safe (sanitizing it).

  • Support for very configurable (optionally) event-based profanity censoring that integrates with nti.schema/zope.schema.

See the documentation for more details.

Changes

1.9.0 (2021-10-26)

  • Fix adapting base string input to plain text to behave more like 1.7 by only running the HTML to plain text algorithm if the input looks like it may contain HTML markup. Note that in some instances where characters like ‘<’ were previously escaped to ‘&lt;’, this will no longer happen if the rest of the string doesn’t look like HTML. See issue 44.

  • Add schema fields VerbatimPlainText and VerbatimPlainTextLine to assume any incoming unicode value already represents a plain text content fragment, instead of (possibly) passing it through the HTML to plain text algorithm.

1.8.0 (2021-10-06)

  • Add support for Python 3.9 and 3.10.

  • Move to Github Actions from Travis CI.

  • The algorithm for converting HTML to plain text has been changed and produces higher quality output. For example, links are preserved in a human-readable fashion. See issue 39.

  • Fix an error getting link text when there was no link formatter utility installed. See PR 42.

1.7.0 (2020-10-07)

  • Allow conversion of reStructuredText fragments to plain text.

1.6.1 (2020-09-14)

  • Ensure disallowed tags nested within anchors do not raise. See issue 34.

1.6.0 (2020-09-02)

  • Add support for reStructuredText content fragments and corresponding fields.

1.5.0 (2020-07-23)

  • When sanitizing html, disable link creation when already under an anchor.

1.4.0 (2020-06-17)

  • Allow IAllowedAttributeProvider to be registered to provide additional attributes that would be allowed in sanitized content fragments.

1.3.0 (2020-04-06)

1.2.1 (2019-11-07)

1.2.0 (2018-10-15)

  • Add support for Python 3.7. Note that datrie is not yet available for Python 3.7.

  • Add support for PyPy3.

  • Add interfaces for all schema fields defined in nti.contentfragments.schema and make the respective classes implement them.

1.1.1 (2018-06-29)

1.1.0 (2017-06-14)

  • Remove dependency of dolmen.builtins. The interfaces IUnicode, IBytes and IString are now always defined by this package.

  • Add support for Python 3.6.

1.0.0 (2016-08-19)

  • Add support for Python 3.

  • Stop configuring plone.i18n. It’s a big dependency and doesn’t work on Python 3.

  • Introduce our own interfaces for IUnicode and IString, subclassing dolmen.builtins.IUnicode and IString, respectively, if possible.

  • The word lists used in censoring are cached in memory.

  • nti.contentfragments.html._Serializer has been renamed and is no longer public.

  • Depend on zope.mimetype >= 2.1.0 for better support of Python 3.

Release files for nti.contentfragments 1.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nti.contentfragments 1.9.0
File Size Uploaded
nti.contentfragments-1.9.0.tar.gz 58.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nti.contentfragments 1.9.0
File Interpreter ABI Platform
nti.contentfragments-1.9.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 115.3 kB

Release files / nti.contentfragments-1.9.0.tar.gz

Download URL nti.contentfragments-1.9.0.tar.gz
Size 58.6 kB
Tags Source
SHA-256 checksum
How to use checksums
4abd0a61861f8a326ec36b4abc74ea37ca368d43f5548186c43e7cfd577c24c2
BLAKE2b-256 checksum
How to use checksums
44fa263ef41cee9a42f5d0b674d144e7030fa295097081bf9a6b15764778c080
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/58.2.0 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.7.12

Release files / nti.contentfragments-1.9.0-py2.py3-none-any.whl

Download URL nti.contentfragments-1.9.0-py2.py3-none-any.whl
Size 56.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
e89e49bc43ab7f2f0a10850f19faf8777359960dd29380c4925b060b2918044b
BLAKE2b-256 checksum
How to use checksums
2051390b387ec4a71f65240d7afadb8d69da53e15c3bae411ba9099ac9aea7a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/58.2.0 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.7.12

Release history Release notifications | RSS feed

This release

1.9.0 This release

2 release files

1.8.0

2 release files

1.7.0

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page