Skip to content

Commit 48e30f1

Browse files
committed
Fix bug where to_snake_case would crash when receiving urls with only digits, fixes #61
1 parent 31dbfe5 commit 48e30f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mkdocs_print_site_plugin/urls.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,12 +279,12 @@ def fix_internal_links(page_html, page_url, directory_urls):
279279
return page_html
280280

281281

282-
def to_snake_case(text):
282+
def to_snake_case(text: str):
283283
"""
284284
Convert string to snake_case.
285285
286286
Example:
287287
288288
'Hi there!' -> 'hi_there_'
289289
"""
290-
return re.sub("\W+", "-", text).lower()
290+
return re.sub("\W+", "-", str(text)).lower()

0 commit comments

Comments
 (0)