summaryrefslogtreecommitdiff
path: root/slugify/slugify.py
diff options
context:
space:
mode:
authorVal Neekman <val@neekware.com>2019-01-03 17:40:15 -0500
committerVal Neekman <val@neekware.com>2019-01-03 17:40:15 -0500
commit8aea5c49b960b66e5c81bf20f17ec23e41c8d157 (patch)
tree72f41588ccc9ae7281220f12fba1f6aff2d5801f /slugify/slugify.py
parent646761e5b4c73b9be7285c60eab4e10c30fe32f4 (diff)
downloadpython-slugify-8aea5c49b960b66e5c81bf20f17ec23e41c8d157.tar.gz
clean up, up version
Diffstat (limited to 'slugify/slugify.py')
-rw-r--r--slugify/slugify.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/slugify/slugify.py b/slugify/slugify.py
index 1544aba..59e9672 100644
--- a/slugify/slugify.py
+++ b/slugify/slugify.py
@@ -165,6 +165,11 @@ def slugify(text, entities=True, decimal=True, hexadecimal=True, max_length=0, w
words = [w for w in text.split(DEFAULT_SEPARATOR) if w not in stopwords]
text = DEFAULT_SEPARATOR.join(words)
+ # finalize user-specific replacements
+ if replacements:
+ for old, new in replacements:
+ text = text.replace(old, new)
+
# smart truncate if requested
if max_length > 0:
text = smart_truncate(text, max_length, word_boundary, DEFAULT_SEPARATOR, save_order)