diff --git a/src/components/leaf.js b/src/components/leaf.js index ea1938962..641f1e3bb 100644 --- a/src/components/leaf.js +++ b/src/components/leaf.js @@ -264,7 +264,7 @@ class Leaf extends React.Component { // COMPAT: If the text is empty otherwise, it's because it's on the edge of // an inline void node, so we render a zero-width space so that the // selection can be inserted next to it still. - if (text == '') return {'\u200B'} + if (text == '') return {'\u200B'} // COMPAT: Browsers will collapse trailing new lines at the end of blocks, // so we need to add an extra trailing new lines to prevent that. diff --git a/src/plugins/core.js b/src/plugins/core.js index 00ffb121e..c68060ad9 100644 --- a/src/plugins/core.js +++ b/src/plugins/core.js @@ -229,7 +229,7 @@ function Plugin(options = {}) { // Remove any zero-width space spans from the cloned DOM so that they don't // show up elsewhere when copied. - const zws = [].slice.call(contents.querySelectorAll('.slate-zero-width-space')) + const zws = [].slice.call(contents.querySelectorAll('[data-slate-zero-width]')) zws.forEach(zw => zw.parentNode.removeChild(zw)) // Wrap the first character of the selection in a span that has the encoded diff --git a/test/rendering/fixtures/custom-block-void/output.html b/test/rendering/fixtures/custom-block-void/output.html index 91dbcfda6..46a590bc8 100644 --- a/test/rendering/fixtures/custom-block-void/output.html +++ b/test/rendering/fixtures/custom-block-void/output.html @@ -3,7 +3,7 @@