1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-20 22:21:20 +02:00

fix to remove need for core plugin to define a default renderMark

This commit is contained in:
Ian Storm Taylor
2016-07-22 12:39:00 -07:00
parent 3c2b1b730b
commit 52e6de488b
3 changed files with 2 additions and 23 deletions

View File

@@ -29,10 +29,6 @@ The core plugin renders a default block and inline node, wrapping in a `<div>` a
The default block node also controls its own placeholder logic, which is controlled via the [`<Editor>`](../components/editor.md)'s placeholder options.
#### `renderMark`
The core plugin adds a default mark with an empty set of styles.
## Overriding Defaults

View File

@@ -243,6 +243,8 @@ class Editor extends React.Component {
const style = plugin.renderMark(mark, marks, this.state.state, this)
if (style) return style
}
return {}
}
/**

View File

@@ -101,14 +101,6 @@ function Plugin(options = {}) {
}
/**
* Define a default mark renderer.
*
* @type {Object}
*/
const DEFAULT_MARK = {}
/**
* Return the plugin.
*/
@@ -291,17 +283,6 @@ function Plugin(options = {}) {
return node.kind == 'block'
? DEFAULT_BLOCK
: DEFAULT_INLINE
},
/**
* The core `mark` renderer, with no styles.
*
* @param {Mark} mark
* @return {Object} style
*/
renderMark(mark) {
return DEFAULT_MARK
}
}
}