I'm trying to make a quote function on this forum I'm making, when I press quote I'm simply filling the textarea
with the markdown, but the only thing is I need to prefix the markdown on each line with >
so that it's a quote.
$('.quotePost').on('click', function(e) {
let quotePostId = $(this).data('quote-id');
let quoteBlock = rawMarkDown.find(x => (x.id === `quote-id-${quotePostId}`));
console.log(quoteBlock.md);
$('#replyBox').val(quoteBlock.md);
});
This is all I have so far.
e.g. of the quoted strings:
> > #HEY
> >
> > This is a test!
so if I hit quote on this it would turn into
> > > #HEY
> > >
> > > This is a test!