Skip to content
This repository has been archived by the owner on Sep 27, 2022. It is now read-only.
Permalink
Browse files Browse the repository at this point in the history
Added escaping characters
  • Loading branch information
KhromovNikita committed Apr 28, 2021
1 parent e884c3c commit 2206c01
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions index.html
Expand Up @@ -4,6 +4,7 @@
<meta charset="UTF-8">
<title>translate</title>
<script type="text/javascript" src="https://onlyoffice.github.io/sdkjs-plugins/v1/plugins.js"></script>
<script type="text/javascript" src="https://onlyoffice.github.io/sdkjs-plugins/v1/plugins-ui.js"></script>
<script src="scripts/translate.js"></script>
<style>
html, body {
Expand Down
2 changes: 1 addition & 1 deletion index_widget.html
Expand Up @@ -148,7 +148,7 @@
else
{
if (msg.data !== "onchange_goog-te-combo") {
document.getElementById("google_translate_element").innerHTML = msg.data;
document.getElementById("google_translate_element").innerHTML = escape(msg.data);
}
timeOut = setTimeout(function() {
document.getElementById("google_translate_element").style.opacity = 1;
Expand Down
2 changes: 1 addition & 1 deletion scripts/translate.js
Expand Up @@ -30,7 +30,7 @@
ifr.onload = function() {
if (ifr.contentWindow.document.readyState == 'complete')
setTimeout(function() {
ifr.contentDocument.getElementById("google_translate_element").innerHTML = text;
ifr.contentDocument.getElementById("google_translate_element").innerHTML = escape(text);
if (text.length)
ifr.contentDocument.getElementById("div_btn").classList.remove("hidden");
}, 500);
Expand Down

0 comments on commit 2206c01

Please sign in to comment.