I tried ChatGPT myself yesterday for the first time and had the same issue with the SVG output stopping at one point. The other solution looks OK, but I dislike the onclick handler and would prefer an anchor tag.