Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Commit

Permalink
missing-headers-on-convertFromHTMLToContentBlocks - Including missing…
Browse files Browse the repository at this point in the history
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
mitermayer authored and Facebook Github Bot 3 committed Mar 17, 2016
1 parent 0c1ec86 commit 6a0bb12
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/rich/rich.html
Original file line number Diff line number Diff line change
Expand Up @@ -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'},
Expand Down
8 changes: 8 additions & 0 deletions src/model/encoding/convertFromHTMLToContentBlocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 6a0bb12

Please sign in to comment.