qrcode icon indicating copy to clipboard operation
qrcode copied to clipboard

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

Open kaveelim opened this issue 5 months ago • 3 comments

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 '&'.

kaveelim avatar Feb 09 '24 01:02 kaveelim