"use strict"; const {strict: assert} = require("assert"); const {zrequire} = require("./lib/namespace"); const {run_test} = require("./lib/test"); const {page_params} = require("./lib/zpage_params"); const copy_and_paste = zrequire("copy_and_paste"); run_test("paste_handler_converter", () => { page_params.development_environment = true; let input = ' love the Zulip Organization.'; assert.equal( copy_and_paste.paste_handler_converter(input), " love the **Zulip** **Organization**.", ); input = 'The JSDOM constructor'; assert.equal(copy_and_paste.paste_handler_converter(input), "The `JSDOM` constructor"); input = 'https://zulip.readthedocs.io/en/latest/subsystems/logging.html'; assert.equal( copy_and_paste.paste_handler_converter(input), "https://zulip.readthedocs.io/en/latest/subsystems/logging.html", ); input = 'Contributing guide'; assert.equal( copy_and_paste.paste_handler_converter(input), "[Contributing guide](https://zulip.readthedocs.io/en/latest/contributing/contributing.html)", ); input = '1. text'; assert.equal(copy_and_paste.paste_handler_converter(input), "1. text"); input = '

Zulip overview

'; assert.equal(copy_and_paste.paste_handler_converter(input), "Zulip overview"); input = 'This text is italic'; assert.equal(copy_and_paste.paste_handler_converter(input), "*This text is italic*"); input = '

Test list:

  • Item 1
  • Item 2
'; assert.equal( copy_and_paste.paste_handler_converter(input), "Test list:\n* Item 1\n* Item 2", ); input = '
Test list:
'; assert.equal( copy_and_paste.paste_handler_converter(input), "Test list:\n* Item 1\n* Item 2", ); });