`t.link` needs to have `"` escaped here. `t.name` has to have `<` and `&` escaped here. I'm sure there are a bunch of other characters that need to be escaped, too.