@@ -66,7 +66,10 @@ def run(self):
66
66
# self.content: StringList(['different, tags,', 'separated'],
67
67
# items=[(path, lineno), (path, lineno)])
68
68
page_tags .extend (
69
- [_normalize_display_tag (tag ) for tag in "," .join (self .content ).split ("," )]
69
+ [
70
+ _normalize_display_tag (tag )
71
+ for tag in "," .join (self .content ).split ("," )
72
+ ]
70
73
)
71
74
# Remove empty elements from page_tags
72
75
# (can happen after _normalize_tag())
@@ -274,7 +277,9 @@ def __init__(self, entrypath: Path):
274
277
275
278
self .tags = []
276
279
if tagblock :
277
- self .tags = [_normalize_display_tag (tag ).rstrip ('"' ) for tag in tagblock if tag != "" ]
280
+ self .tags = [
281
+ _normalize_display_tag (tag ).rstrip ('"' ) for tag in tagblock if tag != ""
282
+ ]
278
283
279
284
def assign_to_tags (self , tag_dict ):
280
285
"""Append ourself to tags"""
@@ -299,12 +304,14 @@ def _normalize_tag(tag: str, dashes: bool = False) -> str:
299
304
char = "-"
300
305
return re .sub (r"[\s\W]+" , char , tag ).lower ().strip (char )
301
306
307
+
302
308
def _normalize_display_tag (tag : str ) -> str :
303
309
"""Strip extra whitespace from a tag name for display purposes.
304
310
305
311
Example: ' Tag:with (extra whitespace) ' -> 'Tag:with (extra whitespace)'
306
312
"""
307
- return re .sub (r"\s+" , ' ' , tag .strip ())
313
+ return re .sub (r"\s+" , " " , tag .strip ())
314
+
308
315
309
316
def tagpage (tags , outdir , title , extension , tags_index_head ):
310
317
"""Creates Tag overview page.
0 commit comments