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:
parent
7723935b68
commit
df23ed7aa7
@ -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('')
|
||||
|
Loading…
x
Reference in New Issue
Block a user