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

Commit

Permalink
Normalize case in convertFromHTMLToContentBlocks variable names
Browse files Browse the repository at this point in the history
Summary: Normalize case in `convertFromHTMLToContentBlocks` variable names. It is often found as `convertFromHTMLtoContentBlocks` (lowercase 'to') and can give us unpleasant surprises in case of codemods

Reviewed By: mitermayer

Differential Revision: D14004772

fbshipit-source-id: e7dc11a6eeedbf2fa3ca607f613f99fa6583942a
  • Loading branch information
Claudio Procida authored and facebook-github-bot committed Feb 9, 2019
1 parent bd799f5 commit b4183b1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/model/encoding/convertFromHTMLToContentBlocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ const convertChunkToContentBlocks = (chunk: Chunk): ?Array<BlockNodeRecord> => {
}, initialState).contentBlocks;
};

const convertFromHTMLtoContentBlocks = (
const convertFromHTMLToContentBlocks = (
html: string,
DOMBuilder: Function = getSafeBodyFromHTML,
blockRenderMap?: DraftBlockRenderMap = DefaultDraftBlockRenderMap,
Expand Down Expand Up @@ -788,4 +788,4 @@ const convertFromHTMLtoContentBlocks = (
};
};

module.exports = convertFromHTMLtoContentBlocks;
module.exports = convertFromHTMLToContentBlocks;
4 changes: 2 additions & 2 deletions src/model/encoding/convertFromHTMLToContentBlocks2.js
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ class ContentBlocksBuilder {
* Converts an HTML string to an array of ContentBlocks and an EntityMap
* suitable to initialize the internal state of a Draftjs component.
*/
const convertFromHTMLtoContentBlocks = (
const convertFromHTMLToContentBlocks = (
html: string,
DOMBuilder: Function = getSafeBodyFromHTML,
blockRenderMap?: DraftBlockRenderMap = DefaultDraftBlockRenderMap,
Expand Down Expand Up @@ -739,4 +739,4 @@ const convertFromHTMLtoContentBlocks = (
.getContentBlocks();
};

module.exports = convertFromHTMLtoContentBlocks;
module.exports = convertFromHTMLToContentBlocks;
12 changes: 6 additions & 6 deletions src/model/paste/DraftPasteProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import type {EntityMap} from 'EntityMap';
const ContentBlock = require('ContentBlock');
const ContentBlockNode = require('ContentBlockNode');

const convertFromHTMLtoContentBlocksClassic = require('convertFromHTMLToContentBlocks');
const convertFromHTMLtoContentBlocksNew = require('convertFromHTMLToContentBlocks2');
const convertFromHTMLToContentBlocksClassic = require('convertFromHTMLToContentBlocks');
const convertFromHTMLToContentBlocksNew = require('convertFromHTMLToContentBlocks2');
const generateRandomKey = require('generateRandomKey');
const getSafeBodyFromHTML = require('getSafeBodyFromHTML');
const gkx = require('gkx');
Expand All @@ -36,16 +36,16 @@ const ContentBlockRecord = experimentalTreeDataSupport
: ContentBlock;

const refactoredHTMLImporter = gkx('draft_refactored_html_importer');
const convertFromHTMLtoContentBlocks = refactoredHTMLImporter
? convertFromHTMLtoContentBlocksNew
: convertFromHTMLtoContentBlocksClassic;
const convertFromHTMLToContentBlocks = refactoredHTMLImporter
? convertFromHTMLToContentBlocksNew
: convertFromHTMLToContentBlocksClassic;

const DraftPasteProcessor = {
processHTML(
html: string,
blockRenderMap?: DraftBlockRenderMap,
): ?{contentBlocks: ?Array<BlockNodeRecord>, entityMap: EntityMap} {
return convertFromHTMLtoContentBlocks(
return convertFromHTMLToContentBlocks(
html,
getSafeBodyFromHTML,
blockRenderMap,
Expand Down

0 comments on commit b4183b1

Please sign in to comment.