outline / rich-markdown-editor

The open source React and Prosemirror based markdown editor that powers Outline. Want to try it out? Create an account:
https://www.getoutline.com
BSD 3-Clause "New" or "Revised" License
2.88k stars 590 forks source link

feat: Attachment of files as block to documents using s3 #624

Open warnus opened 2 years ago

warnus commented 2 years ago

I added file upload feature. (outline commit is https://github.com/outline/outline/pull/2936)

It is almost same with what chanchadsahi, FeralMib did(#280 , #603 ).

The difference is that it is made form of a notice block.

And, I need some help. There are bad code here.

parseMarkdown() { return { block: "container_file", getAttrs: token => { const file_regex = /\[(?<alt>[^]*?)\]\((?<filename>[^]*?)\)/g; const result = file_regex.exec(token.info); return { src: result? result[2] : null, alt: result? result[1] : null, }; }, }; }

I want to place src(file url) and title variable in attributes but, I don't know how to do it.

Can anyone help this?