Skip to content

Commit 8df689e

Browse files
committed
test(Slate) Add a few tests, cleanup code
Signed-off-by: Jerome Simeon <[email protected]>
1 parent 066ab4c commit 8df689e

File tree

10 files changed

+553
-53
lines changed

10 files changed

+553
-53
lines changed

packages/markdown-slate/src/ToSlateVisitor.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@ class ToSlateVisitor {
9696
}
9797

9898
/**
99-
* Converts a formatted inline node to a slate text node with marks
100-
* @param {*} type - the type of inline
101-
* @param {*} data - the data for the inline
102-
* @param {*} text - the text for the inline
99+
* Converts a variable node to a slate text node with marks
100+
* @param {*} type - the type of variable
101+
* @param {*} data - the data for the variable
102+
* @param {*} text - the text for the variable
103103
* @param {*} parameters the parameters
104104
* @returns {*} the slate text node with marks
105105
*/
106-
static handleInline(type, data, text, parameters) {
106+
static handleVariable(type, data, text, parameters) {
107107
return {
108108
object: 'inline',
109109
type: type,
@@ -167,13 +167,13 @@ class ToSlateVisitor {
167167
};
168168
break;
169169
case 'Variable':
170-
result = ToSlateVisitor.handleInline('variable', { id: thing.id }, thing.value, parameters);
170+
result = ToSlateVisitor.handleVariable('variable', { id: thing.id }, thing.value, parameters);
171171
break;
172172
case 'ConditionalVariable':
173-
result = ToSlateVisitor.handleInline('conditional', { id: thing.id }, thing.value, parameters);
173+
result = ToSlateVisitor.handleVariable('conditional', { id: thing.id }, thing.value, parameters);
174174
break;
175175
case 'ComputedVariable':
176-
result = ToSlateVisitor.handleInline('computed', {}, thing.value, parameters);
176+
result = ToSlateVisitor.handleVariable('computed', {}, thing.value, parameters);
177177
break;
178178
case 'CodeBlock':
179179
result = {

0 commit comments

Comments
 (0)