mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-14 11:14:04 +02:00
rename Node.text
to Node.string
(#3341)
This commit is contained in:
@@ -393,7 +393,7 @@ export const Editable = (props: EditableProps) => {
|
||||
placeholder &&
|
||||
editor.children.length === 1 &&
|
||||
Array.from(Node.texts(editor)).length === 1 &&
|
||||
Node.text(editor) === ''
|
||||
Node.string(editor) === ''
|
||||
) {
|
||||
const start = Editor.start(editor, [])
|
||||
decorations.push({
|
||||
|
@@ -74,7 +74,7 @@ const Element = (props: {
|
||||
// If it's a block node with inline children, add the proper `dir` attribute
|
||||
// for text direction.
|
||||
if (!isInline && Editor.hasInlines(editor, element)) {
|
||||
const text = Node.text(element)
|
||||
const text = Node.string(element)
|
||||
const dir = getDirection(text)
|
||||
|
||||
if (dir === 'rtl') {
|
||||
|
@@ -21,7 +21,7 @@ const String = (props: {
|
||||
// COMPAT: Render text inside void nodes with a zero-width space.
|
||||
// So the node can contain selection but the text is not visible.
|
||||
if (editor.isVoid(parent)) {
|
||||
return <ZeroWidthString length={Node.text(parent).length} />
|
||||
return <ZeroWidthString length={Node.string(parent).length} />
|
||||
}
|
||||
|
||||
// COMPAT: If this is the last text node in an empty block, render a zero-
|
||||
@@ -31,7 +31,7 @@ const String = (props: {
|
||||
leaf.text === '' &&
|
||||
parent.children[parent.children.length - 1] === text &&
|
||||
!editor.isInline(parent) &&
|
||||
Editor.text(editor, parentPath) === ''
|
||||
Editor.string(editor, parentPath) === ''
|
||||
) {
|
||||
return <ZeroWidthString isLineBreak />
|
||||
}
|
||||
|
Reference in New Issue
Block a user