1
0
Fork 0
forked from github/pelican
pelican-theme/pelican/tests
Deniz Turgut 03d9c38871 Rewrite pelican.utils.slugify to use unicode and add tests
Adds a use_unicode kwarg to slugify to keep unicode
characters as is (no ASCII-fying) and add tests for
it. Also reworks how slugification logic.

slugify started with the Django method for slugiying:
 - Normalize to compatibility decomposed from (NFKD)
 - Encode and decode with 'ascii'

This works fine if the decomposed form contains ASCII
characters (i.e. ç can be changed in to c+CEDILLA and
ASCII would keep c only), but fails when decomposition
doesn't result in ASCII characters (i.e. Chinese). To
solve that 'unidecode' was added, which works fine for
both cases. However, old method is now redundant but
was kept. This commit removes the old method and
adjusts logic slightly.

Now slugify will normalize all text with composition
mode (NFKC) to unify format for regex substitutions.
And then if use_unicode is False, uses unidecode to
convert it to ASCII.
2020-04-19 20:10:46 +03:00
..
content Add Typogrify/SmartyPants dashes config parameter (#2615) 2020-04-16 13:32:19 +02:00
cyclic_intersite_links Add a test for false-positive warnings about intersite links. 2018-11-11 01:18:53 +01:00
dummy_plugins Fix legacy plugin loading 2020-04-17 21:15:25 +03:00
mixed_content Make StaticGenerator skip content sources. Refs #1019. 2014-10-31 16:46:01 -07:00
nested_content/maindir Make PAGE_EXCLUDES work with subdirs. Fixes #1500. 2014-11-01 17:38:20 -07:00
output Update test output with "description" metadata tag 2020-04-15 16:58:03 +02:00
parse_error Add tests verifying graceful handling on reST errors. 2018-11-10 23:08:10 +01:00
TestPages automatically copy linked static files 2018-11-01 18:08:11 +01:00
theme_overrides Add THEME_TEMPLATE_OVERRIDES. Refs 2021 2017-10-10 14:33:20 +08:00
__init__.py Add logging for warnings during test suite run 2015-10-22 09:45:04 +02:00
default_conf.py Initial pass of removing Python 2 support 2019-11-26 06:16:41 +09:00
support.py Convert super() calls to py3 style 2019-11-26 06:17:04 +09:00
test_cache.py Initial pass of removing Python 2 support 2019-11-26 06:16:41 +09:00
test_contents.py Added an additional assert as requested 2020-04-12 05:18:29 +10:00
test_generators.py Add Typogrify/SmartyPants dashes config parameter (#2615) 2020-04-16 13:32:19 +02:00
test_importer.py Preserve category case in importer 2020-04-15 20:42:21 +02:00
test_log.py Fix LOG_FILTER to act on exact messages 2020-04-12 21:00:27 +03:00
test_paginator.py Convert super() calls to py3 style 2019-11-26 06:17:04 +09:00
test_pelican.py Reset global state set by tests in test_pelican 2020-04-16 11:11:24 +03:00
test_plugins.py Account for existing namespace plugins in plugin tests 2020-04-14 23:52:46 +03:00
test_readers.py Add Typogrify/SmartyPants dashes config parameter (#2615) 2020-04-16 13:32:19 +02:00
test_rstdirectives.py Initial pass of removing Python 2 support 2019-11-26 06:16:41 +09:00
test_server.py Initial pass of removing Python 2 support 2019-11-26 06:16:41 +09:00
test_settings.py Initial pass of removing Python 2 support 2019-11-26 06:16:41 +09:00
test_testsuite.py Initial pass of removing Python 2 support 2019-11-26 06:16:41 +09:00
test_urlwrappers.py Initial pass of removing Python 2 support 2019-11-26 06:16:41 +09:00
test_utils.py Rewrite pelican.utils.slugify to use unicode and add tests 2020-04-19 20:10:46 +03:00