Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion xmodule/js/spec/html/edit_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('HTMLEditingDescriptor', function() {
});
it('Returns data from Raw Editor if text has not changed', function(done) {
const visualEditorStub =
{getContent() { return 'original visual text' }};
{getContent() { return '<p>original visual text</p>' }};
spyOn(this.descriptor, 'getVisualEditor').and.callFake(() => visualEditorStub);

var self = this;
Expand Down
4 changes: 2 additions & 2 deletions xmodule/js/src/html/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -1390,7 +1390,7 @@
haven't dirtied the Editor. Store the raw content so we can compare it later.
*/
this.starting_content = visualEditor.getContent({
format: "text",
format: "raw",
no_events: 1
});
return visualEditor.focus();
Expand All @@ -1410,7 +1410,7 @@
if (this.editor_choice === 'visual') {
visualEditor = this.getVisualEditor();
raw_content = visualEditor.getContent({
format: "text",
format: "raw",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reverts a change in https://github.com/openedx/edx-platform/pull/30335/files#diff-bd3e3877ed43b0228f0227205afd052479229747ee194918aab121957b9b0edbR1393

@DubeySandeep @Agrendalath I don't suppose you could tell us why you made this change when upgrade TinyMCE to v5.5.1?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pdpinch, TinyMCE docs replaced all occurrences of the raw format with text between v4 and v5. These formats are undocumented, and we mistakenly assumed that this is the new way to get/set content in TinyMCE v5.

cc: @tecoholic

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pdpinch What @Agrendalath mentioned in the previous comment. I made the change thinking that the TinyMCE has changed the values from raw to text as there were no references to raw as a value in the docs.

no_events: 1
});
if (this.starting_content !== raw_content) {
Expand Down