mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-17 20:51:20 +02:00
remove hairspace compat for chrome/safari
This commit is contained in:
@@ -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
|
// 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
|
// an inline void node, so we render a zero-width space so that the
|
||||||
// selection can be inserted next to it still.
|
// selection can be inserted next to it still.
|
||||||
if (text == '') {
|
if (text == '') return <span data-slate-zero-width>{'\u200B'}</span>
|
||||||
// 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>
|
|
||||||
}
|
|
||||||
|
|
||||||
// COMPAT: Browsers will collapse trailing new lines at the end of blocks,
|
// 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.
|
// so we need to add an extra trailing new lines to prevent that.
|
||||||
|
Reference in New Issue
Block a user