Skip to content

Commit

Permalink
Ticket OscarGodson#238 - Added spaces so that it'll fail in Firefox i…
Browse files Browse the repository at this point in the history
…f nbsp; aren't

removed
  • Loading branch information
OscarGodson committed Jun 7, 2013
1 parent 2a5a9f1 commit 5e16903
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion epiceditor/js/epiceditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
// Make sure to there aren't two spaces in a row (replace one with  )
// If you find and replace every space with a   text will not wrap.
// Hence the name (Non-Breaking-SPace).

// TODO: Probably need to test this somehow...
content = content.replace(/<br>\s/g, '<br>&nbsp;')
content = content.replace(/\s\s\s/g, '&nbsp; &nbsp;')
content = content.replace(/\s\s/g, '&nbsp; ')
Expand Down
2 changes: 1 addition & 1 deletion src/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
// Make sure to there aren't two spaces in a row (replace one with &nbsp;)
// If you find and replace every space with a &nbsp; text will not wrap.
// Hence the name (Non-Breaking-SPace).

// TODO: Probably need to test this somehow...
content = content.replace(/<br>\s/g, '<br>&nbsp;')
content = content.replace(/\s\s\s/g, '&nbsp; &nbsp;')
content = content.replace(/\s\s/g, '&nbsp; ')
Expand Down
4 changes: 2 additions & 2 deletions test/test.getFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('.getFiles([name])', function () {
fooFile = 'foo' + id;
barFile = 'bar' + id;
editor.load();
editor.importFile(fooFile, 'foo');
editor.importFile(fooFile, 'foo bar');
editor.importFile(barFile, 'bar');
done();
});
Expand Down Expand Up @@ -49,7 +49,7 @@ describe('.getFiles([name])', function () {
expect(file).not.to.be(undefined);
expect(file).to.have.property('modified');
expect(file).to.have.property('created');
expect(file.content).to.be('foo');
expect(file.content).to.be('foo bar');
});

it('should exclude content when excludeContent is set', function () {
Expand Down

0 comments on commit 5e16903

Please sign in to comment.