Added support for block quotes

This commit is contained in:
Jori Lallo
2017-12-30 13:46:21 -08:00
parent 2440788372
commit 330f0eb41d
4 changed files with 7 additions and 0 deletions

View File

@ -304,7 +304,9 @@ const StyledEditor = styled(Editor)`
blockquote {
border-left: 3px solid #efefef;
margin: 1.2em 0;
padding-left: 10px;
font-style: italic;
}
table {

View File

@ -89,6 +89,7 @@ class BlockToolbar extends Component {
switch (type) {
case 'heading1':
case 'heading2':
case 'block-quote':
case 'code':
return this.insertBlock({ type });
case 'horizontal-rule':
@ -159,6 +160,7 @@ class BlockToolbar extends Component {
{this.renderBlockButton('ordered-list', OrderedListIcon)}
{this.renderBlockButton('todo-list', TodoListIcon)}
<Separator />
{this.renderBlockButton('block-quote', Heading2Icon)}
{this.renderBlockButton('code', CodeIcon)}
{this.renderBlockButton('horizontal-rule', HorizontalRuleIcon)}
{this.renderBlockButton('image', ImageIcon)}

View File

@ -92,6 +92,7 @@ class FormattingToolbar extends Component {
<Separator />
{this.renderBlockButton('heading1', Heading1Icon)}
{this.renderBlockButton('heading2', Heading2Icon)}
{this.renderBlockButton('block-quote', Heading2Icon)}
<Separator />
<ToolbarButton onMouseDown={this.handleCreateLink}>
<LinkIcon light />

View File

@ -9,6 +9,7 @@ const schema = {
heading4: { marks: [''] },
heading5: { marks: [''] },
heading6: { marks: [''] },
'block-quote': { marks: [''] },
table: {
nodes: [{ types: ['table-row', 'table-head', 'table-cell'] }],
},
@ -31,6 +32,7 @@ const schema = {
'heading4',
'heading5',
'heading6',
'block-quote',
'code',
'horizontal-rule',
'image',