mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
the composer will now count only significant whitespaces
This commit is contained in:
@@ -10,10 +10,16 @@ describe("Discourse.Composer", function() {
|
||||
});
|
||||
|
||||
it("trims whitespaces", function() {
|
||||
var composer = Discourse.Composer.create({ reply: "\nbasic reply\t" });
|
||||
var composer = Discourse.Composer.create({ reply: " \nbasic reply\t" });
|
||||
expect(composer.get('replyLength')).toBe(11);
|
||||
});
|
||||
|
||||
it("count only significant whitespaces", function() {
|
||||
// this will count the '\n' only once
|
||||
var composer = Discourse.Composer.create({ reply: "ba sic\n\nreply" });
|
||||
expect(composer.get('replyLength')).toBe(12);
|
||||
});
|
||||
|
||||
it("removes quotes", function() {
|
||||
var composer = Discourse.Composer.create({ reply: "1[quote=]not counted[/quote]2[quote=]at all[/quote]3" });
|
||||
expect(composer.get('replyLength')).toBe(3);
|
||||
|
||||
Reference in New Issue
Block a user