Skip to content
Snippets Groups Projects
Commit 3b048323 authored by Julian's avatar Julian
Browse files

Cleaned up syntax and fixed a few things

parent 804eb8ee
Branches
No related tags found
No related merge requests found
Pipeline #7369 passed
......@@ -31,8 +31,8 @@ const renderer = {
return '<code>\n' + code + '</code>\n'
},
blockquote(quote) {
quote = quote.replace(/\n$/, '')
return '> '+quote.replace(/\n/g, '\n>')+'\n'
quote = quote.replace(/\n*$/, '').replace(/\\\\ /, '')
return '> ' + quote.replace(/\n/g, '\n> ') + '\n\n'
},
html(html) {
return '<code>\n' + html + '</code>\n'
......@@ -116,7 +116,7 @@ marked.use({renderer});
function convert_text() {
console.log('converting')
let input = document.getElementById("text-input").value;
let output = marked(input).replace(/\n\n\n*/g, '\n\n');
let output = marked(input).replace(/\n\n\n*/g, '\n\n').replace(/^\n*/, '').replace(/\n*$/, '');
document.getElementById("text-output").value = output;
return false;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment