Skip to content

Commit

Permalink
fix(filebrowser): fix angle brackets and ampersands with syntax highl…
Browse files Browse the repository at this point in the history
…ighting
  • Loading branch information
ravenclaw900 committed Mar 28, 2022
1 parent b00ca1c commit f850397
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/frontend/src/pages/FileBrowser.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,11 @@
$: pathArray = currentPath.split("/").slice(1);
// Set innerHTML manually to avoid issues with highlighting
$: fileDiv != undefined &&
(fileDiv.innerHTML =
fileData[fileData.length - 1] == "\n"
? fileData + " "
: fileData
.replace(new RegExp("&", "g"), "&")
.replace(new RegExp("<", "g"), "&lt;")),
(fileDiv.innerHTML = (
fileData[fileData.length - 1] == "\n" ? fileData + " " : fileData
)
.replace(new RegExp("&", "g"), "&amp;")
.replace(new RegExp("<", "g"), "&lt;")),
microlight.reset();
$: socketData.contents &&
socketData.contents.sort((a, b) => {
Expand Down

0 comments on commit f850397

Please sign in to comment.