Changed single `replace` into global `replace`.

The generated SVG contained non-escaped meta characters: `"<<="` was being changed into `"&lt;<="`. Changed all `replace('...', '...')` into `replace(/.../g, '...')`.