mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-01-19 06:18:16 +01:00
swap html serializer to take rules in options dictionary
This commit is contained in:
parent
2ee317c0a0
commit
ca1dfd904d
@ -154,7 +154,7 @@ const RULES = [
|
||||
* @type {Html}
|
||||
*/
|
||||
|
||||
const serializer = new Html(RULES)
|
||||
const serializer = new Html({ rules: RULES })
|
||||
|
||||
/**
|
||||
* The pasting html example.
|
||||
|
@ -53,13 +53,14 @@ class Html {
|
||||
/**
|
||||
* Create a new serializer with `rules`.
|
||||
*
|
||||
* @param {Array} rules
|
||||
* @param {Object} options
|
||||
* @property {Array} rules
|
||||
* @return {Html} serializer
|
||||
*/
|
||||
|
||||
constructor(rules = []) {
|
||||
constructor(options = {}) {
|
||||
this.rules = [
|
||||
...rules,
|
||||
...(options.rules || []),
|
||||
TEXT_RULE,
|
||||
BR_RULE
|
||||
]
|
||||
|
Loading…
x
Reference in New Issue
Block a user