var bolt = class Blot extends Inline {}
bolt.blotName = 'spoiler';
bolt.tagName = 'div';
$('#bold-button').click(function() {
title = prompt('Enter title');
quill.format('spoiler', title);
});
<div class="spoiler">
<div class="'+title+'_block block">
<a class="'+title+'">title</a>
</div>
<div class="hide">
text
</div>
</div>