1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-19 05:31:56 +02:00

tweak void styles, fix tests

This commit is contained in:
Ian Storm Taylor
2017-10-13 18:05:05 -07:00
parent 5c1d43e3f9
commit 576fb5a133
3 changed files with 10 additions and 13 deletions

View File

@@ -128,20 +128,13 @@ class Void extends React.Component {
const Tag = node.kind == 'block' ? 'div' : 'span'
let style
if (!readOnly && node.kind == 'block') {
if (!readOnly) {
style = {
display: 'block',
height: '0',
color: 'transparent'
}
}
if (!readOnly && node.kind == 'inline') {
style = {
color: 'transparent'
}
}
this.debug('render', { props })
return (

View File

@@ -24,9 +24,11 @@ export const state = (
export const output = `
<div data-slate-editor="true" contenteditable="true" role="textbox">
<div data-slate-void="true">
<span style="display:inline-block;vertical-align:top;width:0;height:0;color:transparent">
<div style="height:0;color:transparent">
<span>
<span></span>
</span>
</div>
<div contenteditable="false">
<img src="https://example.com/image.png">
</div>

View File

@@ -32,9 +32,11 @@ export const output = `
</span>
</span>
<span data-slate-void="true">
<span style="color:transparent">
<span style="height:0;color:transparent">
<span>
<span></span>
</span>
</span>
<span contenteditable="false">
<img>
</span>