DenverCoder1 / github-readme-streak-stats

šŸ”„ Stay motivated and show off your contribution streak! šŸŒŸ Display your total contributions, current streak, and longest streak on your GitHub profile README
https://streak-stats.demolab.com
MIT License
4.66k stars 720 forks source link

Bug `excluded_days` when using it inside `<picture>` #701

Closed scrodrig closed 2 months ago

scrodrig commented 2 months ago

Describe the bug I want to use the streak inside a picture tag for being able to change colors properly based on color system preference, but for some reason is excluding the day from the query param

To Reproduce Steps to reproduce the behavior:

<picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://github-readme-streak-stats.herokuapp.com/?user=scrodrig&theme=darcula&card_width=600px&exclude_days=Sat,Sun" />
    <source media="(prefers-color-scheme: light)" srcset="https://github-readme-streak-stats.herokuapp.com/?user=scrodrig&theme=buefy&card_width=600px&exclude_days=Sat,Sun" />
    <img alt="scrodrig-stats2" src="https://github-readme-streak-stats.herokuapp.com/?user=scrodrig&theme=buefy&card_width=600px&exclude_days=Sat,Sun" />
</picture>

The first one with 7 days is the one from picture, the second one is written normally

<p align="center">
    <img alt="scrodrig-stats2" src="https://github-readme-streak-stats.herokuapp.com/?user=scrodrig&theme=buefy&card_width=600px&exclude_days=Sat,Sun" />
</p>

Expected behavior See the same number of days. You might notice when using inside <picture> is not taking what is next to ,

Screenshots image

Desktop (please complete the following information):

Additional context Seems to be only with that specific query param (related to ,), I also have some issues placing the theme as the last parameter but I couldn't reproduce it properly.

scrodrig commented 2 months ago

Reading a bit of the documentation, this is probably more related to the beta state of <picture> tag in `markdown (Not sure). Documentation suggests this is going to be the new method for theme-based images, https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#specifying-the-theme-an-image-is-shown-to

DenverCoder1 commented 2 months ago

Thanks for reporting!

It appears to me that it's on GitHub's end to fix, but you could try replacing the , with the URI encoding %2C and see if that helps.

<picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://github-readme-streak-stats.herokuapp.com/?user=scrodrig&theme=darcula&card_width=600px&exclude_days=Sat%2CSun" />
    <source media="(prefers-color-scheme: light)" srcset="https://github-readme-streak-stats.herokuapp.com/?user=scrodrig&theme=buefy&card_width=600px&exclude_days=Sat%2CSun" />
    <img alt="scrodrig-stats2" src="https://github-readme-streak-stats.herokuapp.com/?user=scrodrig&theme=buefy&card_width=600px&exclude_days=Sat%2CSun" />
</picture>
scrodrig commented 2 months ago

Yeah, seems it is more related to GitHub end, however using %2C worked, Thanks a lot