Added support for block quotes
This commit is contained in:
@ -304,7 +304,9 @@ const StyledEditor = styled(Editor)`
|
|||||||
|
|
||||||
blockquote {
|
blockquote {
|
||||||
border-left: 3px solid #efefef;
|
border-left: 3px solid #efefef;
|
||||||
|
margin: 1.2em 0;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
|
font-style: italic;
|
||||||
}
|
}
|
||||||
|
|
||||||
table {
|
table {
|
||||||
|
@ -89,6 +89,7 @@ class BlockToolbar extends Component {
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case 'heading1':
|
case 'heading1':
|
||||||
case 'heading2':
|
case 'heading2':
|
||||||
|
case 'block-quote':
|
||||||
case 'code':
|
case 'code':
|
||||||
return this.insertBlock({ type });
|
return this.insertBlock({ type });
|
||||||
case 'horizontal-rule':
|
case 'horizontal-rule':
|
||||||
@ -159,6 +160,7 @@ class BlockToolbar extends Component {
|
|||||||
{this.renderBlockButton('ordered-list', OrderedListIcon)}
|
{this.renderBlockButton('ordered-list', OrderedListIcon)}
|
||||||
{this.renderBlockButton('todo-list', TodoListIcon)}
|
{this.renderBlockButton('todo-list', TodoListIcon)}
|
||||||
<Separator />
|
<Separator />
|
||||||
|
{this.renderBlockButton('block-quote', Heading2Icon)}
|
||||||
{this.renderBlockButton('code', CodeIcon)}
|
{this.renderBlockButton('code', CodeIcon)}
|
||||||
{this.renderBlockButton('horizontal-rule', HorizontalRuleIcon)}
|
{this.renderBlockButton('horizontal-rule', HorizontalRuleIcon)}
|
||||||
{this.renderBlockButton('image', ImageIcon)}
|
{this.renderBlockButton('image', ImageIcon)}
|
||||||
|
@ -92,6 +92,7 @@ class FormattingToolbar extends Component {
|
|||||||
<Separator />
|
<Separator />
|
||||||
{this.renderBlockButton('heading1', Heading1Icon)}
|
{this.renderBlockButton('heading1', Heading1Icon)}
|
||||||
{this.renderBlockButton('heading2', Heading2Icon)}
|
{this.renderBlockButton('heading2', Heading2Icon)}
|
||||||
|
{this.renderBlockButton('block-quote', Heading2Icon)}
|
||||||
<Separator />
|
<Separator />
|
||||||
<ToolbarButton onMouseDown={this.handleCreateLink}>
|
<ToolbarButton onMouseDown={this.handleCreateLink}>
|
||||||
<LinkIcon light />
|
<LinkIcon light />
|
||||||
|
@ -9,6 +9,7 @@ const schema = {
|
|||||||
heading4: { marks: [''] },
|
heading4: { marks: [''] },
|
||||||
heading5: { marks: [''] },
|
heading5: { marks: [''] },
|
||||||
heading6: { marks: [''] },
|
heading6: { marks: [''] },
|
||||||
|
'block-quote': { marks: [''] },
|
||||||
table: {
|
table: {
|
||||||
nodes: [{ types: ['table-row', 'table-head', 'table-cell'] }],
|
nodes: [{ types: ['table-row', 'table-head', 'table-cell'] }],
|
||||||
},
|
},
|
||||||
@ -31,6 +32,7 @@ const schema = {
|
|||||||
'heading4',
|
'heading4',
|
||||||
'heading5',
|
'heading5',
|
||||||
'heading6',
|
'heading6',
|
||||||
|
'block-quote',
|
||||||
'code',
|
'code',
|
||||||
'horizontal-rule',
|
'horizontal-rule',
|
||||||
'image',
|
'image',
|
||||||
|
Reference in New Issue
Block a user