Skip to content

Commit 6802755

Browse files
committed
Remove syntax highlighting
1 parent 074cbf2 commit 6802755

File tree

2 files changed

+2
-36
lines changed

2 files changed

+2
-36
lines changed

webroot/css/style.css

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -522,27 +522,6 @@ h3 {
522522
color: #495057;
523523
}
524524

525-
.json-key {
526-
color: #0066cc;
527-
font-weight: bold;
528-
}
529-
530-
.json-string {
531-
color: #d14;
532-
}
533-
534-
.json-number {
535-
color: #905;
536-
}
537-
538-
.json-boolean {
539-
color: #1e90ff;
540-
}
541-
542-
.json-null {
543-
color: #999;
544-
}
545-
546525
.required-asterisk {
547526
color: #f44336;
548527
margin-left: 2px;

webroot/js/component/output.js

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,6 @@ function createOutputSection() {
1010
`;
1111
}
1212

13-
function highlightJSON(json) {
14-
if (typeof json !== 'string') {
15-
json = JSON.stringify(json, null, 2);
16-
}
17-
18-
return json
19-
.replace(/("[\w\s_-]+")(\s*:)/g, '<span class="json-key">$1</span>$2')
20-
.replace(/:\s*(".*?")/g, ': <span class="json-string">$1</span>')
21-
.replace(/:\s*(\d+\.?\d*)/g, ': <span class="json-number">$1</span>')
22-
.replace(/:\s*(true|false)/g, ': <span class="json-boolean">$1</span>')
23-
.replace(/:\s*(null)/g, ': <span class="json-null">$1</span>');
24-
}
2513

2614
function formatOutput(data) {
2715
if (typeof data === 'string') {
@@ -40,7 +28,7 @@ function formatOutput(data) {
4028
function displayOutput(output) {
4129
const target = document.querySelector('#standardOutput');
4230
if (!target) return;
43-
target.innerHTML = highlightJSON(formatOutput(output));
31+
target.textContent = formatOutput(output);
4432
}
4533

4634
function clearOutput() {
@@ -74,14 +62,13 @@ function initializeOutput() {
7462
if (standardOutput) {
7563
const initialJSON = standardOutput.textContent;
7664
if (initialJSON.trim()) {
77-
standardOutput.innerHTML = highlightJSON(initialJSON);
65+
standardOutput.textContent = initialJSON;
7866
}
7967
}
8068
}
8169

8270
export {
8371
createOutputSection,
84-
highlightJSON,
8572
displayOutput,
8673
displayError,
8774
clearError,

0 commit comments

Comments
 (0)