1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-30 10:29:48 +02:00

fix link example

This commit is contained in:
Ian Storm Taylor
2016-08-02 10:33:02 -07:00
parent 197515e096
commit 0eea98d4a9

View File

@@ -83,7 +83,10 @@ class Links extends React.Component {
const href = window.prompt('Enter the URL of the link:')
state = state
.transform()
.wrapInline('link', new Map({ href }))
.wrapInline({
type: 'link',
data: { href }
})
.collapseToEnd()
.apply()
}
@@ -95,7 +98,10 @@ class Links extends React.Component {
.transform()
.insertText(text)
.extendBackward(text.length)
.wrapInline('link', new Map({ href }))
.wrapInline({
type: 'link',
data: { href }
})
.collapseToEnd()
.apply()
}
@@ -123,7 +129,12 @@ class Links extends React.Component {
}
return transform
.wrapInline('link', { href: data.text })
.wrapInline({
type: 'link',
data: {
href: data.text
}
})
.collapseToEnd()
.apply()
}