1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2025-02-12 00:23:01 +01:00

Fixed tags plugin crashing on numeric title

This commit is contained in:
squidfunk 2025-02-05 21:15:41 +07:00
parent a890d6e951
commit 4861c7d405
No known key found for this signature in database
GPG Key ID: 5ED40BC4F9C436DF
2 changed files with 6 additions and 2 deletions

View File

@ -37,7 +37,9 @@ def tag_name_casefold(tag: Tag, *args):
# Return item title for sorting
def item_title(mapping: Mapping):
return mapping.item.title
# Note that this must be coerced to a string, as the title might be sourced
# from metadata, which can be of any type - see https://t.ly/1AXyo
return str(mapping.item.title)
# Return item URL for sorting
def item_url(mapping: Mapping):

View File

@ -37,7 +37,9 @@ def tag_name_casefold(tag: Tag, *args):
# Return item title for sorting
def item_title(mapping: Mapping):
return mapping.item.title
# Note that this must be coerced to a string, as the title might be sourced
# from metadata, which can be of any type - see https://t.ly/1AXyo
return str(mapping.item.title)
# Return item URL for sorting
def item_url(mapping: Mapping):