enhancing™️ post reply length checker to account for line breaks in redactor

This commit is contained in:
Julian Lam
2017-03-06 09:40:11 -05:00
parent f6721c249f
commit 8226fd6566

View File

@@ -329,7 +329,7 @@ module.exports = function (Topics) {
function check(item, min, max, minError, maxError, callback) {
// Trim and remove HTML (latter for composers that send in HTML, like redactor)
if (typeof item === 'string') {
item = S(item.trim()).stripTags().s;
item = S(item).stripTags().s.trim();
}
if (!item || item.length < parseInt(min, 10)) {