Skip to content

Commit fceb866

Browse files
JulienJay Ng
authored andcommitted
fix(sdk): Fixed statement encoding
1 parent dd4e7e5 commit fceb866

File tree

4 files changed

+6
-18
lines changed

4 files changed

+6
-18
lines changed

runner/src/main/java/com/codingame/gameengine/runner/Renderer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ public void handleRequest(HttpServerExchange exchange) throws Exception {
712712
} catch (IOException ex) {
713713
sendException(e, ex, StatusCodes.BAD_REQUEST);
714714
}
715-
});
715+
}, StandardCharsets.UTF_8);
716716
} else {
717717
exchange.setStatusCode(StatusCodes.NOT_FOUND);
718718
}

runner/src/main/resources/view/statement.css

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -225,36 +225,26 @@ button {
225225
margin-left: 2px;
226226
display: inline-block;
227227
vertical-align: middle;
228+
width: 20px;
229+
height: 20px;
228230
}
229231
.statement-body .statement-section.statement-goal .icon.icon-goal {
230232
background-image: url("/images/statement/icon_statement_goal.png");
231-
width: 20px;
232-
height: 20px;
233233
}
234234
.statement-body .statement-section.statement-rules .icon.icon-rules {
235235
background-image: url("/images/statement/icon_statement_rules.png");
236-
width: 20px;
237-
height: 20px;
238236
}
239237
.statement-body .statement-section.statement-expertrules .icon.icon-expertrules {
240238
background-image: url("/images/statement/icon_statement_expert_rules.png");
241-
width: 20px;
242-
height: 20px;
243239
}
244240
.statement-body .statement-section.statement-warning .icon.icon-warning {
245241
background-image: url("/images/statement/icon_statement_warning.png");
246-
width: 20px;
247-
height: 20px;
248242
}
249243
.statement-body .statement-section.statement-protocol .icon.icon-protocol {
250244
background-image: url("/images/statement/icon_statement_protocol.png");
251-
width: 20px;
252-
height: 20px;
253245
}
254246
.statement-body .statement-section.statement-examples .icon.icon-example {
255247
background-image: url("/images/statement/icon_statement_examples.png");
256-
width: 20px;
257-
height: 20px;
258248
}
259249

260250
.statement-victory-conditions {

runner/src/main/resources/view/statement.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<button id="save" onclick="save()" disabled>Saved</button>
1515
</div>
1616

17-
<div class="statement-body">
17+
<div class="preview">
1818
<div class="preview-title">Preview</div>
1919
<div id="error"></div>
2020
<code id="result"></code>

runner/src/main/resources/view/statement.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ function refreshStatement () {
77
const errorNode = document.getElementById('error')
88

99
try {
10-
resultNode.innerText = getStatementInput()
11-
12-
resultNode.innerHTML = resultNode.innerText.replace('\'', '&#39').replace('≤', '&le;')
10+
resultNode.innerHTML = getStatementInput()
1311

1412
errorNode.innerText = ''
1513
resultNode.style.opacity = 1
@@ -23,7 +21,7 @@ async function load () {
2321
const response = await fetch('/services/statement', {
2422
method: 'GET'
2523
})
26-
statement = await response.text()
24+
const statement = await response.text()
2725
document.getElementById('statementInput').value = statement
2826

2927
refreshStatement()

0 commit comments

Comments
 (0)