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

Commit

Permalink
Fixes lint warnings in convertFromHTMLToContentBlocks2 tests
Browse files Browse the repository at this point in the history
Summary: Fixes lint warnings in convertFromHTMLToContentBlocks2 tests and initializes with defaults from the `clear` method.

Reviewed By: j-nolan

Differential Revision: D13711386

fbshipit-source-id: e5562b69c4388b75ea5a0b5abfb4508ad9096a87
  • Loading branch information
Claudio Procida authored and facebook-github-bot committed Jan 22, 2019
1 parent a3a3585 commit e942ee9
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/model/encoding/convertFromHTMLToContentBlocks2.js
Expand Up @@ -21,13 +21,13 @@ const ContentBlock = require('ContentBlock');
const ContentBlockNode = require('ContentBlockNode');
const DefaultDraftBlockRenderMap = require('DefaultDraftBlockRenderMap');
const DraftEntity = require('DraftEntity');
const {List, Map, OrderedSet} = require('immutable');
const URI = require('URI');

const cx = require('cx');
const generateRandomKey = require('generateRandomKey');
const getSafeBodyFromHTML = require('getSafeBodyFromHTML');
const gkx = require('gkx');
const {List, Map, OrderedSet} = require('immutable');

const experimentalTreeDataSupport = gkx('draft_tree_data_support');

Expand Down Expand Up @@ -205,22 +205,22 @@ class ContentBlocksBuilder {

// The following attributes are used to accumulate text and styles
// as we are walking the HTML node tree.
characterList: List<CharacterMetadata>;
currentBlockType: string;
currentDepth: number;
currentEntity: ?string;
currentStyle: DraftInlineStyle;
currentText: string;
wrapper: string;
characterList: List<CharacterMetadata> = List();
currentBlockType: string = 'unstyled';
currentDepth: number = -1;
currentEntity: ?string = null;
currentStyle: DraftInlineStyle = OrderedSet();
currentText: string = '';
wrapper: string = 'ul';

// Describes the future ContentState as a tree of content blocks
blockConfigs: Array<ContentBlockConfig>;
blockConfigs: Array<ContentBlockConfig> = [];

// The content blocks generated from the blockConfigs
contentBlocks: Array<BlockNodeRecord>;
contentBlocks: Array<BlockNodeRecord> = [];

// Entity map use to store links and images found in the HTML nodes
entityMap: EntityMap;
entityMap: EntityMap = DraftEntity;

// Map HTML tags to draftjs block types and disambiguation function
blockTypeMap: BlockTypeMap;
Expand Down

0 comments on commit e942ee9

Please sign in to comment.