3

I'm trying to make some helper buttons similar to stackoverflow markdown editor in epiceditor

I tried this method but this actually overrides the actual file and not append to it

this is an example for bold button

$('.icon-bold').click(function(){
   editor.importFile('epiceditor', '**strong text**')
});

How could i append a text to a file using epiceditor ?

i think this solution is overkill in large files

 $('.icon-bold').click(function(){
   content = editor.exportFile('epiceditor');
   editor.importFile('epiceditor',content + '**strong text**')
 });

0 Answers0