Skip to content

A platform for community discussion. Free, open, simple.

FIX: Fixed changing composer mode escaping title (#7191)

Tim Langedcd56cf5934c
diff --git a/app/assets/javascripts/discourse/controllers/composer.js.es6 b/app/assets/javascripts/discourse/controllers/composer.js.es6
index 52deb54fb28..b69ec6fdfec 100644
--- a/app/assets/javascripts/discourse/controllers/composer.js.es6
+++ b/app/assets/javascripts/discourse/controllers/composer.js.es6
@@ -910,7 +910,7 @@ export default Ember.Controller.extend({
opts.topicTitle &&
opts.topicTitle.length <= this.siteSettings.max_topic_title_length
) {
- this.set("model.title", escapeExpression(opts.topicTitle));
+ this.set("model.title", opts.topicTitle);
}
if (opts.topicCategoryId) {
diff --git a/test/javascripts/acceptance/composer-actions-test.js.es6 b/test/javascripts/acceptance/composer-actions-test.js.es6
index 9ee3868bbcf..51db4a41f5c 100644
--- a/test/javascripts/acceptance/composer-actions-test.js.es6
+++ b/test/javascripts/acceptance/composer-actions-test.js.es6
@@ -139,7 +139,10 @@ QUnit.test("shared draft", async assert => {
await visit("/");
await click("#create-topic");
- await fillIn("#reply-title", "This is the new text for the title");
+ await fillIn(
+ "#reply-title",
+ "This is the new text for the title using 'quotes'"
+ );
await fillIn(".d-editor-input", "This is the new text for the post");
await tags.expand();
await tags.selectRowByValue("monkey");
@@ -149,6 +152,11 @@ QUnit.test("shared draft", async assert => {
assert.equal(tags.header().value(), "monkey", "tags are not reset");
+ assert.equal(
+ find("#reply-title").val(),
+ "This is the new text for the title using 'quotes'"
+ );
+
assert.equal(
find("#reply-control .btn-primary.create .d-button-label").text(),
I18n.t("composer.create_shared_draft")