message: fix focus and too many <p>s after a Event>Quote in RT mode
diff: @@ -387,17 +387,28 @@ export default class MessageComposerInput extends React.Component {
  const anchorText = editorState.anchorText;
  if ((!anchorText || anchorText.text === '') && editorState.anchorBlock.nodes.size === 1) {
  // replace the current block rather than split the block
  + // XXX: this destroys our focus by deleting the thing we are anchored/focused on
  change = change.replaceNodeByKey(editorState.anchorBlock.key, quote);
  - }
  - else {
  + } else {
  // insert it into the middle of the block (splitting it)
  change = change.insertBlock(quote);
  }
  - change = change.insertFragmentByKey(quote.key, 0, fragment.document)
  - .focus();
  - this.onChange(change);
  +
  + // XXX: heuristic to strip out wrapping <p> which breaks quoting in RT mode
  + if (fragment.document.nodes.size && fragment.document.nodes.get(0).type === DEFAULT_NODE) {
  + change = change.insertFragmentByKey(quote.key, 0, fragment.document.nodes.get(0));
  + } else {
  + change = change.insertFragmentByKey(quote.key, 0, fragment.document);
  }
  - else {
  +
  + // XXX: this is to bring back the focus in a sane place and add a paragraph after it
  + change = change.select({
  + anchorKey: quote.key,
  + focusKey: quote.key,
  + }).collapseToEndOfBlock().insertBlock(Block.create(DEFAULT_NODE)).focus();
  +
  + this.onChange(change);
  + } else {
  let fragmentChange = fragment.change();
  fragmentChange.moveToRangeOf(fragment.document)
  .wrapBlock(quote);
  