Commit 9d541bae authored by carlosperate's avatar carlosperate

Fix C++ code generation HTML scape characters.

parent c19569e8
......@@ -427,8 +427,8 @@ ul.side-nav li.side-menu-end {
position: absolute !important;
right: 0px !important;
top: 0px !important;
width: 56px !important;
height: 56px !important;
width: 55px !important;
height: 55px !important;
z-index: 5;
}
.spinner-orange {
......
......@@ -113,7 +113,7 @@ Ardublockly.ideSendUpload = function() {
Ardublockly.showExtraIdeButtons(false);
Ardublockly.setIdeSettings(null, 'upload');
}
Materialize.toast('Opening sketch in the Arduino IDE...', 4000);
Materialize.toast('Uploading sketch into Arduino...', 4000);
Ardublockly.sendCode();
};
......@@ -135,7 +135,7 @@ Ardublockly.ideSendOpen = function() {
Ardublockly.showExtraIdeButtons(false);
Ardublockly.setIdeSettings(null, 'open');
}
Materialize.toast('Uploading sketch into Arduino...', 4000);
Materialize.toast('Opening sketch in the Arduino IDE...', 4000);
Ardublockly.sendCode();
};
......@@ -527,6 +527,9 @@ Ardublockly.renderContent = function() {
var arduinoCode = Ardublockly.generateArduino();
if (arduinoCode !== Ardublockly.PREVIOUS_ARDUINO_CODE_) {
var arduinoContent = document.getElementById('content_arduino');
// Sets content in case of no pretify and serves as a fast way to scape html
arduinoContent.textContent = arduinoCode;
arduinoCode = arduinoContent.innerHTML;
if (typeof prettyPrintOne == 'function') {
var diff = JsDiff.diffWords(Ardublockly.PREVIOUS_ARDUINO_CODE_,
arduinoCode);
......@@ -539,10 +542,8 @@ Ardublockly.renderContent = function() {
resultStringArray.push(diff[i].value);
}
}
var codeHtml = prettyPrintOne(resultStringArray.join(''), 'cpp');
var codeHtml = prettyPrintOne(resultStringArray.join(''), 'cpp', false);
arduinoContent.innerHTML = codeHtml;
} else {
arduinoContent.textContent = arduinoCode;
}
Ardublockly.PREVIOUS_ARDUINO_CODE_ = arduinoCode;
}
......
......@@ -17,55 +17,42 @@
.str {
color: #718c00;
}
.kwd {
color: #5E6D03;
}
.com {
color: #8e908c;
}
.typ {
color: #00979C;
}
.lit {
color: #f5871f;
}
.pun {
color: #4d4d4c;
}
.opn {
color: #4d4d4c;
}
.clo {
color: #4d4d4c;
}
.tag {
color: #c82829;
}
.atn {
color: #f5871f;
}
.atv {
color: #3e999f;
}
.dec {
color: #f5871f;
}
.var {
color: #c82829;
}
.fun {
color: #4271ae;
}
......@@ -74,39 +61,31 @@
.str {
color: #006600;
}
.kwd {
color: #006;
font-weight: bold;
}
.com {
color: #600;
font-style: italic;
}
.typ {
color: #404;
font-weight: bold;
}
.lit {
color: #004444;
}
.pun, .opn, .clo {
color: #444400;
}
.tag {
color: #006;
font-weight: bold;
}
.atn {
color: #440044;
}
.atv {
color: #006600;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment