diff --git a/frontend_tests/node_tests/templates.js b/frontend_tests/node_tests/templates.js index 1c42efa541..c12a34f1e0 100644 --- a/frontend_tests/node_tests/templates.js +++ b/frontend_tests/node_tests/templates.js @@ -870,7 +870,7 @@ run_test('message_group', () => { { msg: { content: 'This is message two.', - match_content: 'This is message two.', + match_content: 'This is message two.\n
code\nblock
', is_stream: true, unread: true, id: 2, @@ -897,7 +897,7 @@ run_test('message_group', () => { assert.equal(first_message_text, "This is message one."); var last_message_html = $(html).next('.recipient_row').find('div.messagebox').last().find('.message_content').html().trim(); - assert.equal(last_message_html, 'This is message two.'); + assert.equal(last_message_html, 'This is message two.\n
code\nblock
'); var highlighted_topic_word = $(html).find('a.narrows_by_topic .highlight').text(); assert.equal(highlighted_topic_word, 'two'); diff --git a/frontend_tests/zjsunit/handlebars.js b/frontend_tests/zjsunit/handlebars.js index 7054c6d490..3cceafbbbb 100644 --- a/frontend_tests/zjsunit/handlebars.js +++ b/frontend_tests/zjsunit/handlebars.js @@ -14,7 +14,10 @@ module.exports.make_handlebars = () => { const name = "$" + path.relative(templates_path, filename); if (!compiled.has(name)) { compiled.add(name); - hb.registerPartial(name, hb.compile(fs.readFileSync(filename, "utf-8"), { zjsFilename: filename })); + hb.registerPartial( + name, + hb.compile(fs.readFileSync(filename, "utf-8"), { preventIndent: true, zjsFilename: filename }) + ); } return name; }; diff --git a/tools/webpack.config.ts b/tools/webpack.config.ts index f1dfee1329..c6776497f9 100644 --- a/tools/webpack.config.ts +++ b/tools/webpack.config.ts @@ -87,6 +87,7 @@ export default (env?: string): webpack.Configuration[] => { // The ones below are defined in static/js/templates.js 'partial', 'plural', 'eq', 'and', 'or', 'not', 't', 'tr'], + preventIndent: true, }, }, // load fonts and files