Skip to content
This repository was archived by the owner on Nov 13, 2021. It is now read-only.

Commit 8f744ce

Browse files
committed
WIP: import md feature
1 parent 57ff44e commit 8f744ce

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

dist/bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/import-markdown.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { fileUploadHandler } from './file-handler';
1+
import * as remark from 'remark';
2+
23
export default class ImportMarkdown {
34
constructor({ data, api }) {
45
this.data = data;
@@ -35,19 +36,18 @@ export default class ImportMarkdown {
3536

3637
fileUpload.onchange = (e) => {
3738
const file = e.target.files[0];
38-
console.log(file);
3939

4040
const reader = new FileReader();
4141
reader.readAsText(file, 'UTF-8');
4242

4343
reader.onload = (readerEvent) => {
4444
const content = readerEvent.target.result;
4545
console.log(content);
46+
console.log(remark().parse(content));
47+
return remark().parse(content);
4648
};
4749
};
4850
fileUpload.click();
49-
console.log('fileupload log');
50-
console.log(fileUpload);
5151
}
5252

5353
save() {

0 commit comments

Comments
 (0)