{"id":5518,"library":"textile","title":"Textile","description":"Textile is a Python port of Dean Allen's humane web text generator, allowing conversion of Textile-formatted text into HTML. The library is currently in active development, with version 4.0.3 released in September 2024, and receives periodic updates to maintain compatibility and introduce improvements.","status":"active","version":"4.0.3","language":"en","source_language":"en","source_url":"https://github.com/textile/python-textile.git","tags":["markup","text-to-html","textile","parser"],"install":[{"cmd":"pip install textile","lang":"bash","label":"Install stable version"},{"cmd":"pip install 'textile[imagesize]'","lang":"bash","label":"Install with optional image size dependency (Pillow)"}],"dependencies":[{"reason":"HTML sanitization","package":"nh3"},{"reason":"Advanced regular expression capabilities; can cause issues with PyPy.","package":"regex","optional":true},{"reason":"Required for image size checking. Installable via 'textile[imagesize]'.","package":"Pillow","optional":true}],"imports":[{"note":"The main module and the primary function share the same name.","symbol":"textile","correct":"import textile"}],"quickstart":{"code":"import textile\n\ntextile_input = \"\"\"\n_This_ is a *test.*\\n\n* One\n* Two\n* Three\n\nLink to \"Slashdot\":http://slashdot.org/\n\"\"\"\n\nhtml_output = textile.textile(textile_input)\nprint(html_output)","lang":"python","description":"Initialize the textile parser and convert a sample Textile string to HTML."},"warnings":[{"fix":"Upgrade to Python 3.8+ or pin to `textile<4.0.0` for older Python versions.","message":"Python 2.x and older Python 3.x versions (3.2, 3.3, 3.4) are no longer supported. Users on these environments should use Textile Version 3.0.","severity":"breaking","affected_versions":"<4.0.0"},{"fix":"Review HTML output if your application relies on specific sanitization rules. Adjust inputs or sanitize pre/post-processing if necessary.","message":"The underlying HTML sanitization library was switched from `html5lib` to `nh3`. This might subtly change sanitization behavior for some inputs.","severity":"breaking","affected_versions":"4.0.3 and later"},{"fix":"In PyPy environments, run `pip uninstall regex` if `textile` functionality is affected.","message":"The `regex` package, an optional dependency, can cause compatibility problems when running `textile` in PyPy environments. If you encounter issues, uninstall `regex`.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}