Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generate_svg() failed when the input string contain '&' #19

Open
kaveelim opened this issue Feb 9, 2024 · 3 comments
Open

generate_svg() failed when the input string contain '&' #19

kaveelim opened this issue Feb 9, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@kaveelim
Copy link

kaveelim commented Feb 9, 2024

generate_svg() failed when the input string contain '&'.

library(qrcode)

qr_code("https://docs.google.com/forms/viewform?vc=0&c=0&w=1&flr=0", ecl = "H") |> 
  generate_svg("myqrcode.svg")

Created on 2024-02-09 with reprex v2.1.0

Here is the first few lines of myqrcode.svg.

<?xml version="1.0" encoding="UTF-8" ?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="300" width="300">
<g id="qrcode:https://docs.google.com/forms/viewform?vc=0&c=0&w=1&flr=0">

The problem seems to come from the <g id="..."> which contains '&'.

@ThierryO ThierryO added the bug Something isn't working label Feb 9, 2024
@ThierryO ThierryO self-assigned this Feb 9, 2024
@ThierryO
Copy link
Owner

ThierryO commented Feb 9, 2024

I can confirm the bug. I'll look for a solution. I probably need to escape the & in the < g id> element.

ThierryO pushed a commit that referenced this issue Mar 17, 2024
@ThierryO
Copy link
Owner

@kaveelim can you check this version of the package?

@kaveelim
Copy link
Author

kaveelim commented Mar 17, 2024

@kaveelim can you check this version of the package?

Great!, I can confirm that it's working as expected. Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants