Skip to content

Commit

Permalink
Revert "Refactor code to insert attachment into markdown cell"
Browse files Browse the repository at this point in the history
This reverts commit 414a549.
  • Loading branch information
Madhu94 committed Jun 1, 2019
1 parent 945540b commit 75b45d7
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/cells/src/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1207,12 +1207,8 @@ export class AttachmentsCell extends Cell {
const reader = new FileReader();
reader.readAsDataURL(blob);
reader.onload = evt => {
const { href, protocol } = URLExt.parse(reader.result as string);
if (protocol !== 'data:') {
return;
}
const content = href.split(':')[1];
const [mimeType, encodedData] = content.split(';');
const { pathname } = URLExt.parse(reader.result as string);
const [mimeType, encodedData] = pathname.split(';');
const data = encodedData.split(',')[1];
const bundle: nbformat.IMimeBundle = { [mimeType]: data };
this.model.attachments.set(blob.name, bundle);
Expand Down

0 comments on commit 75b45d7

Please sign in to comment.