TinyMCE : Multi lang code appears along with its text #933995 #23
+3
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @srobotta Currently after selecting text in TinyMCE and applying a language through the Language button, the multilang content is not properly saved to the server, causing a disconnect between what's displayed in the editor and what's actually stored.
Steps to reproduce:
Result :

Root Cause: The root cause of this issue is when we save a form that contains multilang content, the multilang2 plugin listens to the submit event and calls removeVisualStyling(). This function processes the editor content by converting TinyMCE's visual placeholder tags.
The problem is that after removeVisualStyling() modifies the editor content, the plugin doesn't sync these changes back to the underlying form field. So while the editor display shows the processed content, the form still submits the original unprocessed content to the server.
Solution: Add editor.save() call after removeVisualStyling() to force TinyMCE to sync the modified editor content back to the actual form field that gets submitted to the server.
Could you please review my PR?