Escape additional chars in data-* attributes [Closes #1075]

While escaping single quotes preserves basic object integrity,
escaping additional special characters preserves string integrity,
particularly when the JSON itself contains an escape sequence.