Skip to content

Commit 0338e02

Browse files
committed
Rename option name
1 parent 7bfa475 commit 0338e02

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ var rawDraftJSObject = markdownToDraft(markdownString, {
177177
...
178178
}
179179
},
180-
remarkableSingletons: ['atomic_block']
180+
remarkableStandaloneBlocks: ['atomic_block']
181181
});
182182

183183
```

src/markdown-to-draft.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ const DefaultBlockStyles = {
102102
};
103103

104104
// Remarkable blocks that stands alone.
105-
const DefaultRemarkableSingletons = [
105+
const DefaultRemarkableStandaloneBlocks = [
106106
'hr',
107107
'fence'
108108
]
@@ -235,7 +235,7 @@ function markdownToDraft(string, options = {}) {
235235
const BlockTypes = Object.assign({}, DefaultBlockTypes, options.blockTypes || {});
236236
const BlockEntities = Object.assign({}, DefaultBlockEntities, options.blockEntities || {});
237237
const BlockStyles = Object.assign({}, DefaultBlockStyles, options.blockStyles || {});
238-
const RemarkableSingletons = DefaultRemarkableSingletons.concat(options.remarkableSingletons)
238+
const RemarkableStandaloneBlocks = DefaultRemarkableStandaloneBlocks.concat(options.remarkableStandaloneBlocks)
239239

240240
parsedData.forEach(function (item) {
241241
// Because of how remarkable's data is formatted, we need to cache what kind of list we're currently dealing with
@@ -261,7 +261,7 @@ function markdownToDraft(string, options = {}) {
261261

262262
// The entity map is a master object separate from the block so just add any entities created for this block to the master object
263263
Object.assign(entityMap, blockEntities);
264-
} else if ((itemType.indexOf('_open') !== -1 || RemarkableSingletons.includes(itemType)) && BlockTypes[itemType]) {
264+
} else if ((itemType.indexOf('_open') !== -1 || RemarkableStandaloneBlocks.includes(itemType)) && BlockTypes[itemType]) {
265265
var depth = 0;
266266
var block;
267267

test/markdown-to-draft.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ describe('markdownToDraft', function () {
554554
}
555555
}
556556
},
557-
remarkableSingletons: ['yaml_frontmatter']
557+
remarkableStandaloneBlocks: ['yaml_frontmatter']
558558
});
559559

560560
expect(conversionResult.blocks[0].type).toEqual('atomic');

0 commit comments

Comments
 (0)