diff --git a/cms/djangoapps/contentstore/features/html-editor.feature b/cms/djangoapps/contentstore/features/html-editor.feature index a23bc4650d..6da09b75d2 100644 --- a/cms/djangoapps/contentstore/features/html-editor.feature +++ b/cms/djangoapps/contentstore/features/html-editor.feature @@ -47,6 +47,26 @@ Feature: CMS.HTML Editor --> """ + Scenario: TinyMCE and CodeMirror preserve span tags + Given I have created a Blank HTML Page + When I edit the page + And type "Test" in the code editor and press OK + And I save the page + Then the page text contains: + """ + Test + """ + + Scenario: TinyMCE and CodeMirror preserve math tags + Given I have created a Blank HTML Page + When I edit the page + And type "x2" in the code editor and press OK + And I save the page + Then the page text contains: + """ + x2 + """ + Scenario: TinyMCE toolbar buttons are as expected Given I have created a Blank HTML Page When I edit the page @@ -57,7 +77,7 @@ Feature: CMS.HTML Editor When I edit the page And type "" in the code editor and press OK Then the src link is rewritten to "c4x/MITx/999/asset/image.jpg" - And the code editor displays "

" + And the code editor displays "

" Scenario: Code format toolbar button wraps text with code tags Given I have created a Blank HTML Page diff --git a/common/lib/xmodule/xmodule/js/src/html/edit.coffee b/common/lib/xmodule/xmodule/js/src/html/edit.coffee index 97e713dad5..4af098cf89 100644 --- a/common/lib/xmodule/xmodule/js/src/html/edit.coffee +++ b/common/lib/xmodule/xmodule/js/src/html/edit.coffee @@ -48,8 +48,16 @@ class @HTMLEditingDescriptor height: '400px', menubar: false, statusbar: false, + # Necessary to avoid stripping of style tags. valid_children : "+body[style]", + + # Allow any elements to be used, e.g. link, script, math + verify_html: false, + valid_elements: "*[*]", + extended_valid_elements: "*[*]", + invalid_elements: "", + setup: @setupTinyMCE, # Cannot get access to tinyMCE Editor instance (for focusing) until after it is rendered. # The tinyMCE callback passes in the editor as a parameter.