draft-js-code icon indicating copy to clipboard operation
draft-js-code copied to clipboard

support 'code' in hasSelectionInBlock (see react-draft-wysiwyg)

Open lefnire opened this issue 7 years ago • 2 comments

I'm new to Draft, I don't know if code-block is a standard and should be followed, or if you get to make your own or what. https://github.com/jpuri/react-draft-wysiwyg inserts code, so this adds support for that (alternatively ~currentBlock.getType().indexOf('code') in case other editors use codeblock or whatever).

lefnire avatar Jan 10 '18 18:01 lefnire

Coverage Status

Coverage remained the same at 99.265% when pulling ebcd05731f77c34a07f0a210b136bed37f0ac014 on lefnire:master into c219dc50d42f7db9c69b4b8c9be4b437116e8e6a on SamyPesse:master.

coveralls avatar Jan 10 '18 18:01 coveralls

Ah, <pre> maps to code-block, and <code> to code. So this PR should cover everything

lefnire avatar Jan 10 '18 20:01 lefnire