withspectrum/draft-js-markdown-plugin

Pasting code breaks format

andrewfan opened this issue · 2 comments

Formatting breaks after pasting the code
when I paste https://www.dropbox.com/s/cshujh5l3tc6ox6/Screenshot%202018-05-17%2018.44.30.png?dl=0
I see this https://www.dropbox.com/s/owsg95juumx8jfu/Screenshot%202018-05-17%2018.45.58.png?dl=0

I tried to debug and saw that if I remove code-block from here https://github.com/withspectrum/draft-js-markdown-plugin/blob/master/src/index.js#L234
everything works like intended
so I have 2 questions

  1. why does it happens?
  2. is it very important to render code block as code tag or we can simply remove this rule from blockRenderMap?

Can you deploy a preview with that line removed? I'm sure it's gotta be there for a reason, something must break with it removed.

@mxstbr http://synonymous-liquid.surge.sh/
I think that bug comes from draft-js, I created the issue there facebookarchive/draft-js#1769
Please take a look at the example and if it is not critical for the project to wrap code block in <pre><code> I will remove code-block from blockRenderMap