From 6a0bb1296d353998f007847ee250365f2cee7848 Mon Sep 17 00:00:00 2001 From: miter Date: Thu, 17 Mar 2016 11:41:28 -0700 Subject: [PATCH] =?UTF-8?q?missing-headers-on-convertFromHTMLToContentBloc?= =?UTF-8?q?ks=20-=20Including=20missing=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary:This fixes issue https://github.com/facebook/draft-js/issues/206 - Adding missing headers for convertFromHTMLToContentBlocks Closes https://github.com/facebook/draft-js/pull/207 Reviewed By: ezequiel Differential Revision: D3053014 fb-gh-sync-id: 8cf5eaab6b85352d177620e1421023da0b92e295 shipit-source-id: 8cf5eaab6b85352d177620e1421023da0b92e295 --- examples/rich/rich.html | 4 ++++ src/model/encoding/convertFromHTMLToContentBlocks.js | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/examples/rich/rich.html b/examples/rich/rich.html index ae7cc55897..d9596142e8 100644 --- a/examples/rich/rich.html +++ b/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'}, diff --git a/src/model/encoding/convertFromHTMLToContentBlocks.js b/src/model/encoding/convertFromHTMLToContentBlocks.js index 217e2e4007..5626326974 100644 --- a/src/model/encoding/convertFromHTMLToContentBlocks.js +++ b/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';