qrcode
qrcode copied to clipboard
generate_svg() failed when the input string contain '&'
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 '&'.
I can confirm the bug. I'll look for a solution. I probably need to escape the &
in the < g id>
element.
@kaveelim can you check this version of the package?
@kaveelim can you check this version of the package?
Great!, I can confirm that it's working as expected. Thank you very much.