From 6febff1000a7c687443a406f35f0b385eb3c0ccc Mon Sep 17 00:00:00 2001 From: python-slugify-11 Date: Wed, 14 Oct 2026 16:30:15 +0000 Subject: [PATCH] docs: add max_length example to README Add a short executable max_length example to the Quickstart section. Closes-topic: #11 --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 2a68581..1a00a9f 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,9 @@ assert slugify("C'est déjà l'été.", algorithm='modern') == 'c-est-deja-l-ete assert slugify('影師嗎', backend='text-unidecode', algorithm='modern') == 'ying-shi-ma' assert slugify('影師嗎', allow_unicode=True, algorithm='modern') == '影師嗎' +# Truncate long slugs with max_length. +assert slugify('Hello, world!', max_length=8) == 'hello-wo' + # Calling slugify() without algorithm uses the legacy pipeline (the old default), # kept unchanged for backward compatibility. assert slugify("C'est déjà l'été.") == 'c-est-deja-l-ete'