Skip to content

Commit

Permalink
mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakehu2020 authored Jul 26, 2024
1 parent be69ef8 commit db5b58f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion assets/js/nodejs.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ document.addEventListener("DOMContentLoaded",(e) => {
addToOutput("Initialized!\n");

editor.addEventListener('input', (e) => {
let text = editor.replace(/</g, "&lt;").replace(/>/g, "&gt;");
let text = editor.innerText.replace(/</g, "&lt;").replace(/>/g, "&gt;");
text = text.replace(/(".*?"|'.*?'|`.*?`)/g, '<span class="js-string">$1</span>');
text = text.replace(/\b(const|let|var|function|if|else|for|while|return|true|false|null|undefined)\b/, '<span class="js-keyword">$1</span>');
text = text.replace(/\b(\d+)\b/g, '<span class="js-number">$1</span>');
Expand Down

0 comments on commit db5b58f

Please sign in to comment.