Skip to content

Commit

Permalink
[lexical-markdown] Breaking Change: rename 'multilineElement' to 'mul…
Browse files Browse the repository at this point in the history
…tiline-element' (#6617)
  • Loading branch information
potatowagon authored Sep 11, 2024
1 parent 46929e0 commit 5c82b38
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/lexical-markdown/flow/LexicalMarkdown.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export type MultilineElementTransformer = {
linesInBetween: Array<string> | null,
isImport: boolean,
) => boolean | void;
type: 'multilineElement';
type: 'multiline-element';
};

export type TextFormatTransformer = $ReadOnly<{
Expand Down
2 changes: 1 addition & 1 deletion packages/lexical-markdown/src/MarkdownShortcuts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ export function registerMarkdownShortcuts(
if (
type === 'element' ||
type === 'text-match' ||
type === 'multilineElement'
type === 'multiline-element'
) {
const dependencies = transformer.dependencies;
for (const node of dependencies) {
Expand Down
4 changes: 2 additions & 2 deletions packages/lexical-markdown/src/MarkdownTransformers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export type MultilineElementTransformer = {
*/
isImport: boolean,
) => boolean | void;
type: 'multilineElement';
type: 'multiline-element';
};

export type TextFormatTransformer = Readonly<{
Expand Down Expand Up @@ -399,7 +399,7 @@ export const CODE: MultilineElementTransformer = {
})(rootNode, children, startMatch, isImport);
}
},
type: 'multilineElement',
type: 'multiline-element',
};

export const UNORDERED_LIST: ElementTransformer = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const MDX_HTML_TRANSFORMER: MultilineElementTransformer = {
}
return false; // Run next transformer
},
type: 'multilineElement',
type: 'multiline-element',
};

describe('Markdown', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/lexical-markdown/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ export function transformersByType(transformers: Array<Transformer>): Readonly<{

return {
element: (byType.element || []) as Array<ElementTransformer>,
multilineElement: (byType.multilineElement ||
multilineElement: (byType['multiline-element'] ||
[]) as Array<MultilineElementTransformer>,
textFormat: (byType['text-format'] || []) as Array<TextFormatTransformer>,
textMatch: (byType['text-match'] || []) as Array<TextMatchTransformer>,
Expand Down

0 comments on commit 5c82b38

Please sign in to comment.