An inner single-quote pair breaks out of the outer single-quote pair. Rather than escaping the inner quotes to protect against this, just use the fact that `str()` is equivalent to `""`.