mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
fix: tag like C++ and C# are treated as a same tag
This commit is contained in:
parent
772005f431
commit
2217f0e755
2 changed files with 5 additions and 3 deletions
|
|
@ -144,7 +144,9 @@ DEFAULT_CONFIG = {
|
|||
'TEMPLATE_EXTENSIONS': ['.html'],
|
||||
'IGNORE_FILES': ['.#*'],
|
||||
'SLUG_REGEX_SUBSTITUTIONS': [
|
||||
(r'[^\w\s-]', ''), # remove non-alphabetical/whitespace/'-' chars
|
||||
# remove all characters except alphanumeric, whitespace,
|
||||
# '_', '-', '+', '#' characters
|
||||
(r'[^\w\s\-#\+]', ''),
|
||||
(r'(?u)\A\s*', ''), # strip leading whitespace
|
||||
(r'(?u)\s*\Z', ''), # strip trailing whitespace
|
||||
(r'[-\s]+', '-'), # reduce multiple whitespace or '-' to single '-'
|
||||
|
|
@ -387,7 +389,7 @@ def handle_deprecated_settings(settings):
|
|||
|
||||
if replace:
|
||||
regex_subs += [
|
||||
(r'[^\w\s-]', ''),
|
||||
(r'[^\w\s\-#\+]', ''),
|
||||
(r'(?u)\A\s*', ''),
|
||||
(r'(?u)\s*\Z', ''),
|
||||
(r'[-\s]+', '-'),
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ class TestUtils(LoggedTestCase):
|
|||
def test_slugify_substitute(self):
|
||||
|
||||
samples = (('C++ is based on C', 'cpp-is-based-on-c'),
|
||||
('C+++ test C+ test', 'cpp-test-c-test'),
|
||||
('C+++ test C+ test', 'cpp+-test-c+-test'),
|
||||
('c++, c#, C#, C++', 'cpp-c-sharp-c-sharp-cpp'),
|
||||
('c++-streams', 'cpp-streams'),)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue