comparison app/assets/javascripts/init.tabs.js @ 124:4a8cefa814f1

Options for marked (enabling sanitize).
author Edho Arief <edho@myconan.net>
date Mon, 12 Nov 2012 15:33:11 +0700
parents 5b58b0d6841c
children 64f73525503b
comparison
equal deleted inserted replaced
123:5b58b0d6841c 124:4a8cefa814f1
1 $(document).ready(function() { 1 $(document).ready(function() {
2 if ($('#paste-tabs').length == 1) { 2 if ($('#paste-tabs').length == 1) {
3 raw = $('#plain pre').text(); 3 raw = $('#plain pre').text();
4 4
5 marked.setOptions({
6 gfm: true,
7 pedantic: false,
8 sanitize: true
9 });
5 $('#markdown div').html(marked(raw)); 10 $('#markdown div').html(marked(raw));
6 $('#markdown div pre').addClass('prettyprint'); 11 $('#markdown div pre').addClass('prettyprint');
7 $('#markdown div a').prop('rel', 'nofollow'); 12 $('#markdown div a').prop('rel', 'nofollow');
8 13
9 $('#highlight pre').text(raw); 14 $('#highlight pre').text(raw);