mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-02-13 19:57:00 +01:00
fix rich text example
This commit is contained in:
parent
bd200cf4b8
commit
8654dfc929
@ -177,7 +177,19 @@ class RichText extends React.Component {
|
||||
// Handle everything but list buttons.
|
||||
if (type != 'bulleted-list' && type != 'numbered-list') {
|
||||
const isActive = this.hasBlock(type)
|
||||
transform = transform.setBlock(isActive ? DEFAULT_NODE : type)
|
||||
const isList = this.hasBlock('list-item')
|
||||
|
||||
if (isList) {
|
||||
transform = transform
|
||||
.setBlock(isActive ? DEFAULT_NODE : type)
|
||||
.unwrapBlock('bulleted-list')
|
||||
.unwrapBlock('numbered-list')
|
||||
}
|
||||
|
||||
else {
|
||||
transform = transform
|
||||
.setBlock(isActive ? DEFAULT_NODE : type)
|
||||
}
|
||||
}
|
||||
|
||||
// Handle the extra wrapping required for list buttons.
|
||||
|
Loading…
x
Reference in New Issue
Block a user