nodebb-plugin-composer-default 9.2.0 → 9.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/library.js +3 -3
- package/package.json +1 -1
- package/static/templates/compose.tpl +1 -1
package/library.js
CHANGED
|
@@ -188,7 +188,7 @@ plugin.filterComposerBuild = async function (hookData) {
|
|
|
188
188
|
}
|
|
189
189
|
globalPrivileges['topics:tag'] = canTagTopics;
|
|
190
190
|
const cid = parseInt(req.query.cid, 10);
|
|
191
|
-
const topicTitle = topicData && topicData.title ? topicData.title.replace(/%/g, '%').replace(/,/g, ',') :
|
|
191
|
+
const topicTitle = topicData && topicData.title ? topicData.title.replace(/%/g, '%').replace(/,/g, ',') : req.query.title;
|
|
192
192
|
return {
|
|
193
193
|
req: req,
|
|
194
194
|
res: res,
|
|
@@ -254,8 +254,8 @@ async function generateBody(req, postData) {
|
|
|
254
254
|
const translated = await translator.translate(`[[modules:composer.user_said, ${username}]]`);
|
|
255
255
|
return `${translated}\n` +
|
|
256
256
|
`> ${postData ? `${postData.content.replace(/\n/g, '\n> ')}\n\n` : ''}`;
|
|
257
|
-
} else if (req.query.body) {
|
|
258
|
-
return req.query.body;
|
|
257
|
+
} else if (req.query.body || req.query.content) {
|
|
258
|
+
return validator.escape(String(req.query.body || req.query.content));
|
|
259
259
|
}
|
|
260
260
|
return postData ? postData.content : '';
|
|
261
261
|
}
|
package/package.json
CHANGED
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
[[modules:composer.compose]] <span class="help hidden"><i class="fa fa-question-circle"></i></span>
|
|
92
92
|
<span class="toggle-preview hide">[[modules:composer.show_preview]]</span>
|
|
93
93
|
</div>
|
|
94
|
-
<textarea name="content" form="compose-form" class="write" tabindex="5" placeholder="[[modules:composer.textarea.placeholder]]"
|
|
94
|
+
<textarea name="content" form="compose-form" class="write" tabindex="5" placeholder="[[modules:composer.textarea.placeholder]]">{body}</textarea>
|
|
95
95
|
</div>
|
|
96
96
|
<div class="col-md-6 hidden-sm hidden-xs preview-container">
|
|
97
97
|
<div class="help-text">
|