Skip to content

Conversation

@bbbhltz
Copy link

@bbbhltz bbbhltz commented Apr 18, 2025

  • changed atom encoding in blag.py to utf-8 in order to pass https://validator.w3.org/feed/ feed validation
  • changed markdown.py to replace space in tags with dash in order to avoid urls with spaces

Hi,

I'm really enjoying this software. I have two small suggestions. I am still very green when it comes to Python and website development, but I don't think these small changes break anything.

  https://validator.w3.org/feed/ feed validation
* changed replace space in tags with dash
blag/blag.py Outdated
)

with open(f"{output_dir}/atom.xml", "w") as fh:
feed.write(fh, encoding="utf8")
Copy link
Owner

Choose a reason for hiding this comment

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

Are you sure this actually changes something? I think utf8 and utf-8 are synonymous.

Copy link
Author

Choose a reason for hiding this comment

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

I think they are synonymous, but after making that change my atom feed passed the W3C Feed Validation Test.

e.g. this atom feed compared to this one, both are valid.

Copy link
Owner

Choose a reason for hiding this comment

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

Very good catch, thank you! I've fixed this and added a test for correct encoding in a separate PR.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants