nodebb-plugin-composer-default 9.2.4 → 9.2.6
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/package.json
CHANGED
|
@@ -71,12 +71,14 @@ define('composer/autocomplete', [
|
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
73
|
var editor;
|
|
74
|
-
if (targetEl.nodeName === 'TEXTAREA') {
|
|
74
|
+
if (targetEl.nodeName === 'TEXTAREA' || targetEl.nodeName === 'INPUT') {
|
|
75
75
|
editor = new TextareaEditor(targetEl);
|
|
76
76
|
} else if (targetEl.nodeName === 'DIV' && targetEl.getAttribute('contenteditable') === 'true') {
|
|
77
77
|
editor = new ContenteditableEditor(targetEl);
|
|
78
78
|
}
|
|
79
|
-
|
|
79
|
+
if (!editor) {
|
|
80
|
+
throw new Error('unknown target element type');
|
|
81
|
+
}
|
|
80
82
|
// yuku-t/textcomplete inherits directionality from target element itself
|
|
81
83
|
targetEl.setAttribute('dir', document.querySelector('html').getAttribute('data-dir'));
|
|
82
84
|
|
package/static/lib/composer.js
CHANGED
|
@@ -443,7 +443,7 @@ define('composer', [
|
|
|
443
443
|
var data = {
|
|
444
444
|
title: title,
|
|
445
445
|
titleLength: title.length,
|
|
446
|
-
body: postData.body,
|
|
446
|
+
body: utils.escapeHTML(postData.body),
|
|
447
447
|
mobile: composer.bsEnvironment === 'xs' || composer.bsEnvironment === 'sm',
|
|
448
448
|
resizable: true,
|
|
449
449
|
thumb: postData.thumb,
|