mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-07-31 12:30:11 +02:00
port update to serialization pr to master
This commit is contained in:
@@ -57,7 +57,11 @@ import { Text } from 'slate'
|
|||||||
|
|
||||||
const serialize = node => {
|
const serialize = node => {
|
||||||
if (Text.isText(node)) {
|
if (Text.isText(node)) {
|
||||||
return escapeHtml(node.text)
|
let string = escapeHtml(node.text)
|
||||||
|
if (node.bold) {
|
||||||
|
string = `<strong>${string}</strong>`
|
||||||
|
}
|
||||||
|
return string
|
||||||
}
|
}
|
||||||
|
|
||||||
const children = node.children.map(n => serialize(n)).join('')
|
const children = node.children.map(n => serialize(n)).join('')
|
||||||
|
Reference in New Issue
Block a user