1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-01-18 05:59:13 +01:00

port update to serialization pr to master

This commit is contained in:
Ian Storm Taylor 2021-03-31 22:00:33 -04:00
parent 7723935b68
commit df23ed7aa7

View File

@ -57,7 +57,11 @@ import { Text } from 'slate'
const serialize = 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('')