Skip to content

[Bug]: Badge URLs with spaces are not URL-encoded #206

Description

@wlangera

What happened?

The README template generates the following badge for the CC BY 4.0 license:

[![CC BY 4.0](https://img.shields.io/badge/License-CC BY 4.0-brightgreen)](...)

When rendered on GitHub, the badge is broken because the spaces in the Shields.io URL are not URL-encoded. It looks like this:

![CC BY 4.0](https://img.shields.io/badge/License-CC BY 4.0-brightgreen)

Replacing the spaces with %20 fixes the issue:

[![CC BY 4.0](https://img.shields.io/badge/License-CC%20BY%204.0-brightgreen)](...)

which looks like

CC BY 4.0

Minimal reproducible example

Created automatically in README when creating a project with `checklist::create_project()`

Session information

─ Session info ────────────────────────────────────────────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.6.0 (2026-04-24 ucrt)
 os       Windows 11 x64 (build 26200)
 system   x86_64, mingw32
 ui       RStudio
 language (EN)
 collate  Dutch_Belgium.utf8
 ctype    Dutch_Belgium.utf8
 tz       Europe/Brussels
 date     2026-07-23
 rstudio  2026.06.0+242 Blue Plumbago (desktop)
 pandoc   NA
 quarto   1.9.38 @ C:\\PROGRA~1\\RStudio\\RESOUR~1\\app\\bin\\quarto\\bin\\quarto.exe

─ Packages ────────────────────────────────────────────────────────────────────────────────────────────────────────
 package     * version date (UTC) lib source
 cli           3.6.6   2026-04-09 [1] CRAN (R 4.6.0)
 fortunes      1.5-4   2016-12-29 [1] CRAN (R 4.6.0)
 rstudioapi    0.19.0  2026-06-11 [1] CRAN (R 4.6.0)
 sessioninfo   1.2.4   2026-06-04 [1] CRAN (R 4.6.0)

 [1] C:/R/library
 [2] C:/R/R-4.6.0/library

───────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions