nodebb-plugin-composer-default 10.3.6 → 10.3.7

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 CHANGED
@@ -178,7 +178,9 @@ plugin.filterComposerBuild = async function (hookData) {
178
178
  }
179
179
  globalPrivileges['topics:tag'] = canTagTopics;
180
180
  const cid = parseInt(req.query.cid, 10);
181
- const topicTitle = topicData && topicData.title ? topicData.title.replace(/%/g, '%').replace(/,/g, ',') : validator.escape(String(req.query.title || ''));
181
+ const topicTitle = topicData && topicData.title ?
182
+ topicData.title :
183
+ validator.escape(String(req.query.title || ''));
182
184
  return {
183
185
  req: req,
184
186
  res: res,
@@ -197,6 +199,13 @@ plugin.filterComposerBuild = async function (hookData) {
197
199
  // can't use title property as that is used for page title
198
200
  topicTitle: topicTitle,
199
201
  titleLength: topicTitle ? topicTitle.length : 0,
202
+ titleLabel: translator.compile(
203
+ isEditing ?
204
+ 'topic:composer.editing-in' :
205
+ 'topic:composer.replying-to',
206
+ `"${topicTitle}"`
207
+ ),
208
+
200
209
  topic: topicData,
201
210
  thumb: topicData ? topicData.thumb : '',
202
211
  body: body,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-composer-default",
3
- "version": "10.3.6",
3
+ "version": "10.3.7",
4
4
  "description": "Default composer for NodeBB",
5
5
  "main": "library.js",
6
6
  "repository": {
@@ -444,18 +444,19 @@ define('composer', [
444
444
  var isGuestPost = postData ? parseInt(postData.uid, 10) === 0 : false;
445
445
  const isScheduled = postData.timestamp > Date.now();
446
446
 
447
- // see
448
- // https://github.com/NodeBB/NodeBB/issues/2994 and
449
- // https://github.com/NodeBB/NodeBB/issues/1951
450
- // remove when 1951 is resolved
451
-
452
- var title = postData.title.replace(/%/g, '%').replace(/,/g, ',');
453
447
  postData.category = await getSelectedCategory(postData);
454
448
  const privileges = postData.category ? postData.category.privileges : ajaxify.data.privileges;
455
449
  const topicTemplate = isTopic && postData.category ? postData.category.topicTemplate : '';
456
- var data = {
457
- topicTitle: title,
458
- titleLength: title.length,
450
+
451
+ let data = {
452
+ topicTitle: postData.title,
453
+ titleLength: postData.title.length,
454
+ titleLabel: translator.compile(
455
+ isEditing ?
456
+ 'topic:composer.editing-in' :
457
+ 'topic:composer.replying-to',
458
+ `"${postData.title}"`
459
+ ),
459
460
  body: utils.escapeHTML(translator.escape(postData.body) || topicTemplate),
460
461
  mobile: composer.bsEnvironment === 'xs' || composer.bsEnvironment === 'sm',
461
462
  resizable: true,
@@ -12,7 +12,7 @@
12
12
  </div>
13
13
  {{{ end }}}
14
14
  {{{ if !isTopicOrMain }}}
15
- <h4 class="title text-bg-primary">{{{ if isEditing }}}[[topic:composer.editing-in, "{topicTitle}"]]{{{ else }}}[[topic:composer.replying-to, "{topicTitle}"]]{{{ end }}}</h4>
15
+ <h4 class="title text-bg-primary">{titleLabel}</h4>
16
16
  {{{ end }}}
17
17
  <div class="display-scheduler p-2 {{{ if !canSchedule }}} hidden{{{ end }}}">
18
18
  <i class="fa fa-clock-o"></i>
@@ -15,7 +15,7 @@
15
15
  {{{ if isTopicOrMain }}}
16
16
  <input class="title form-control h-100 rounded-1 shadow-none" type="text" placeholder="[[topic:composer.title-placeholder]]" value="{topicTitle}" />
17
17
  {{{ else }}}
18
- <span class="{{{ if !template.compose }}}d-none d-md-block{{{ else }}}d-block{{{ end }}} title h-100 text-truncate">{{{ if isEditing }}}[[topic:composer.editing-in, "{topicTitle}"]]{{{ else }}}[[topic:composer.replying-to, "{topicTitle}"]]{{{ end }}}</span>
18
+ <span class="{{{ if !template.compose }}}d-none d-md-block{{{ else }}}d-block{{{ end }}} title h-100 text-truncate">{titleLabel}</span>
19
19
  {{{ end }}}
20
20
  <div id="quick-search-container" class="quick-search-container mt-2 dropdown-menu d-block p-2 hidden">
21
21
  <div class="text-center loading-indicator"><i class="fa fa-spinner fa-spin"></i></div>