Skip to content
Browse files

missing-headers-on-convertFromHTMLToContentBlocks - Including missing…

Summary:This fixes issue #206

- Adding missing headers for convertFromHTMLToContentBlocks
Closes #207

Reviewed By: ezequiel

Differential Revision: D3053014

fb-gh-sync-id: 8cf5eaab6b85352d177620e1421023da0b92e295
shipit-source-id: 8cf5eaab6b85352d177620e1421023da0b92e295
  • Loading branch information...
1 parent 0c1ec86 commit 6a0bb1296d353998f007847ee250365f2cee7848 @mitermayer mitermayer committed with Facebook Github Bot 3
Showing with 12 additions and 0 deletions.
  1. +4 −0 examples/rich/rich.html
  2. +8 −0 src/model/encoding/convertFromHTMLToContentBlocks.js
View
4 examples/rich/rich.html
@@ -159,6 +159,10 @@
const BLOCK_TYPES = [
{label: 'H1', style: 'header-one'},
{label: 'H2', style: 'header-two'},
+ {label: 'H3', style: 'header-three'},
+ {label: 'H4', style: 'header-four'},
+ {label: 'H5', style: 'header-five'},
+ {label: 'H6', style: 'header-six'},
{label: 'Blockquote', style: 'blockquote'},
{label: 'UL', style: 'unordered-list-item'},
{label: 'OL', style: 'ordered-list-item'},
View
8 src/model/encoding/convertFromHTMLToContentBlocks.js
@@ -122,6 +122,14 @@ function getBlockTypeForTag(tag: string, lastList: ?string): DraftBlockType {
return 'header-one';
case 'h2':
return 'header-two';
+ case 'h3':
+ return 'header-three';
+ case 'h4':
+ return 'header-four';
+ case 'h5':
+ return 'header-five';
+ case 'h6':
+ return 'header-six';
case 'li':
if (lastList === 'ol') {
return 'ordered-list-item';

0 comments on commit 6a0bb12

Please sign in to comment.
Something went wrong with that request. Please try again.