diff --git a/common/lib/xmodule/xmodule/js/spec/html/edit_spec.js b/common/lib/xmodule/xmodule/js/spec/html/edit_spec.js index aeef2f111d..cfa3f1225a 100644 --- a/common/lib/xmodule/xmodule/js/spec/html/edit_spec.js +++ b/common/lib/xmodule/xmodule/js/spec/html/edit_spec.js @@ -40,6 +40,14 @@ describe('HTMLEditingDescriptor', function() { expect(visualEditorStub.getContent()).toEqual('text /c4x/foo/bar/asset/image.jpg'); }); it('Enables spellcheck', () => expect($('.html-editor iframe')[0].contentDocument.body.spellcheck).toBe(true)); + it('Retains ascii characters', function() { + const editorData = 'fóó'; + const expectedData = '
' + + this.descriptor.getVisualEditor().setContent(editorData) + const savedContent = this.descriptor.getVisualEditor().getContent() + expect(savedContent).toEqual(expectedData); + }); }); describe('Raw HTML Editor', function() { beforeEach(function() { diff --git a/common/lib/xmodule/xmodule/js/src/html/edit.js b/common/lib/xmodule/xmodule/js/src/html/edit.js index 34de8437b7..cc2c798ccc 100644 --- a/common/lib/xmodule/xmodule/js/src/html/edit.js +++ b/common/lib/xmodule/xmodule/js/src/html/edit.js @@ -101,6 +101,7 @@ theme: "modern", skin: 'studio-tmce4', schema: "html5", + entity_encoding: "raw", /* Necessary to preserve relative URLs to our images.