Create a bookmark with the following link:
javascript: (function () { var title = window.prompt('Make new note on HackMD', document.title); if (!title) return; var lines = [document.title, '', '[' + document.title + '](' + window.location.href + ')']; var quote = window.getSelection().toString(); if (quote.trim()) lines = lines.concat(quote.split(/\n/g).map(function (line) { return ' > ' + line })); lines.push(''); var body = encodeURIComponent(lines.join('\n')); window.open('https://hackmd.io/new?title=' + body) })();Minified version:
javascript:!function(){if(window.prompt("Make new note on HackMD",document.title)){var n=[document.title,"","["+document.title+"]("+window.location.href+")"],t=window.getSelection().toString();t.trim()&&(n=n.concat(t.split(/\n/g).map(function(n){return" > "+n}))),n.push("");var o=encodeURIComponent(n.join("\n"));window.open("https://hackmd.io/new?title="+o)}}();