1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-07-31 20:40:19 +02:00

allow for passing default block type to html serializer

This commit is contained in:
Ian Storm Taylor
2016-12-01 19:21:54 -08:00
parent 03653256d6
commit 35b97b7c0e

View File

@@ -69,6 +69,7 @@ class Html {
*
* @param {Object} options
* @property {Array} rules
* @property {String} defaultBlockType
*/
constructor(options = {}) {
@@ -76,6 +77,8 @@ class Html {
...(options.rules || []),
TEXT_RULE
]
this.defaultBlockType = options.defaultBlockType || 'paragraph'
}
/**
@@ -105,7 +108,7 @@ class Html {
const block = {
kind: 'block',
type: 'paragraph',
type: this.defaultBlockType,
nodes: [node]
}