1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-15 11:44:05 +02:00

remove hairspace compat for chrome/safari

This commit is contained in:
Ian Storm Taylor
2017-10-26 14:04:08 -07:00
parent 753b88747e
commit db6e29fbe3

View File

@@ -133,12 +133,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 == '') {
// COMPAT: In Chrome, zero-width space produces graphics glitches, so use
// hair space in place of it. (2017/02/12)
const space = IS_FIREFOX ? '\u200B' : '\u200A'
return <span data-slate-zero-width>{space}</span>
}
if (text == '') return <span data-slate-zero-width>{'\u200B'}</span>
// 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.