global.stub_out_jquery(); set_global('page_params', { development: true, }); var jsdom = require("jsdom"); global.document = jsdom.jsdom('
Hello world
'); var window = jsdom.jsdom().defaultView; global.$ = require('jquery')(window); zrequire('toMarkdown', 'node_modules/to-markdown/dist/to-markdown.js'); var copy_and_paste = zrequire('copy_and_paste'); (function test_paste_handler() { var input = ' love the Zulip Organization.'; assert.equal(copy_and_paste.paste_handler_converter(input), 'love the **Zulip****Organization**.'); input = 'TheJSDOM
constructor';
assert.equal(copy_and_paste.paste_handler_converter(input),
'The `JSDOM` constructor');
input = 'https://zulip.readthedocs.io/en/latest/subsystems/logging.html';
// TODO: for cases where one is just pasting a link, we'd prefer
// that this not use markdown syntax, since that feels unnecessary.
assert.equal(copy_and_paste.paste_handler_converter(input),
'[https://zulip.readthedocs.io/en/latest/subsystems/logging.html](https://zulip.readthedocs.io/en/latest/subsystems/logging.html "https://zulip.readthedocs.io/en/latest/subsystems/logging.html")');
input = '