Updated to use jquery's data method instead of attr('data-snippet'), as it wasn't picking up changes made using data in snippets