withspectrum / draft-js-markdown-plugin

An opinionated DraftJS plugin for supporting Markdown syntax shortcuts
https://markdown-plugin.spectrum.chat/
MIT License
139 stars 42 forks source link

Pasting code is totally broken - each line creates a new code block element #88

Closed brianlovin closed 6 years ago

brianlovin commented 6 years ago

Pasting

getRawMarkup() {
    const md = new Remarkable();
    return { __html: md.render(this.state.value) };
  }

looks like this: screenshot 2018-06-06 15 38 39

@mxstbr can we please hotfix this? We have lots of developer communities moving over and this is really really painful.

juliankrispel commented 6 years ago

I'm looking at this. @mxstbr sent you a message - a little stuck with the env setup for spectrum (unfortunately I need to start the entire app to test and debug this) - maybe it'd be worth adding a story to contain this or something...

mxstbr commented 6 years ago

@juliankrispel you might be able to hack around it by doing

$ yarn
$ yarn run dev:web

and then opening localhost:3000/new/thread?

juliankrispel commented 6 years ago

@mxstbr ok - figured it out. Basically the results were always consistent, you get separate code blocks in the markdown plugin as well - it's just that the css in Spectrum puts a margin on code blocks :D

Opened a pr with a change that inserts plain text when pasted into code blocks #90 rather than default handling...