(function () {
    'use strict';

    document.addEventListener('DOMContentLoaded', function () {
        var instructions = document.querySelector('#instructions');
        var paste_bin = document.querySelector('#paste-bin');
        var output = document.querySelector('#output');
        var output_wrapper = document.querySelector('#output-wrapper');
        var clear = document.querySelector('#clear');

        document.addEventListener('keydown', function (event) {
            if (event.ctrlKey || event.metaKey) {
                if (String.fromCharCode(event.which).toLowerCase() === 'v') {
                    paste_bin.innerHTML = '';
                    paste_bin.focus();
                    instructions.classList.add('hidden');
                    output_wrapper.classList.add('hidden');
                }
            }
        });

        paste_bin.addEventListener('paste', function () {
            setTimeout(read_paste_bin, 200);
        });

        var read_paste_bin = function () {
            var text_html = paste_bin.innerHTML;
            var text_markdown = html2markdown(text_html, {
                inlineStyle: true
            });
            output.value = text_markdown;
            output_wrapper.classList.remove('hidden');
        };

        clear.addEventListener('click', function () {
            output.value = '';
            output_wrapper.classList.add('hidden');
        });

    });
})();

@@ -1,8 +1,322 @@
+function trim(value) %7B%0A    return value.replace(/%5E%5Cs+%7C%5Cs+$/g, %22%22);%0A%7D%0A%0Afunction asciify(str) %7B%0A    return str.replace(/%5B%5Cu2018%5Cu2019%5D/g, %22'%22)%0A              .replace(/%5B%5Cu201c%5Cu201d%5D/g, '%22')%0A              .replace(/%5Cu2013/g, %22--%22)%0A              .replace(/%5Cu2014/g, %22---%22)%0A              .replace(/%5Cu2026/g, %22...%22);%0A%7D%0A%0A
 (functio
@@ -1398,16 +1398,29 @@
 kdown = 
+trim(asciify(
 html2mar
@@ -1486,16 +1486,18 @@
       %7D)
+))
 ;%0A      

Convert punctuation to pure ASCII