mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-14 03:03:58 +02:00
fix rich text example
This commit is contained in:
@@ -177,7 +177,19 @@ class RichText extends React.Component {
|
|||||||
// Handle everything but list buttons.
|
// Handle everything but list buttons.
|
||||||
if (type != 'bulleted-list' && type != 'numbered-list') {
|
if (type != 'bulleted-list' && type != 'numbered-list') {
|
||||||
const isActive = this.hasBlock(type)
|
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.
|
// Handle the extra wrapping required for list buttons.
|
||||||
|
Reference in New Issue
Block a user