Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions blag/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def convert_markdown(
* `date` is converted into datetime with local timezone
* `tags` is interpreted as a comma-separeted list of strings.
All strings are stripped and converted to lower case.
All strings have spaces replaced with dashes.

Parameters
----------
Expand Down Expand Up @@ -85,6 +86,7 @@ def convert_markdown(
tags = meta["tags"].split(",")
tags = [t.lower() for t in tags]
tags = [t.strip() for t in tags]
tags = [t.replace(" ","-") for t in tags]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thise change seems reasonable, can you write a test case that ensures that the replace is working?

Copy link
Author

@bbbhltz bbbhltz Apr 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can certainly try, and I might also suggest changing it to:

tags = ['-'.join(t.split()) for t in tags]

in case of accidental double-spaces.

meta["tags"] = tags

return content, meta
Expand Down