Skip to content

Commit

Permalink
notepad: CRLF
Browse files Browse the repository at this point in the history
  • Loading branch information
binzume committed Dec 15, 2023
1 parent 9240fdd commit 4041bf3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apps/notepad/notepad.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

AFRAME.registerComponent('notepad-app', {
schema: {},
/** @type {FileInfo} */
file: null,
init() {
this.file = null;
this.appManager = null;
let editorEl = /** @type {AFRAME.AEntity & {value: string}} */ (this.el.querySelector('[texteditor]'));
let editor = editorEl.components.texteditor;
Expand Down Expand Up @@ -95,7 +96,7 @@ TODO:
let res = await (this.file.fetch ? this.file.fetch() : fetch(this.file.url));
if (this.file == file) {
setMimeType(mimeType);
editorEl.value = await res.text();
editorEl.value = (await res.text()).replace("\r\n", "\n");
}
}
};
Expand Down

0 comments on commit 4041bf3

Please sign in to comment.