mirror of https://github.com/buster-so/buster.git
can parse dollar signs
This commit is contained in:
parent
438bec4ce4
commit
48fa337303
|
@ -28,7 +28,7 @@ import { LineHeightKit } from './plugins/line-height-kit';
|
||||||
import { LinkKit } from './plugins/link-kit';
|
import { LinkKit } from './plugins/link-kit';
|
||||||
import { ListKit } from './plugins/list-kit';
|
import { ListKit } from './plugins/list-kit';
|
||||||
import { MarkdownKit } from './plugins/markdown-kit';
|
import { MarkdownKit } from './plugins/markdown-kit';
|
||||||
import { MathKit } from './plugins/math-kit';
|
// import { MathKit } from './plugins/math-kit';
|
||||||
import { MediaKit } from './plugins/media-kit';
|
import { MediaKit } from './plugins/media-kit';
|
||||||
import { MentionKit } from './plugins/mention-kit';
|
import { MentionKit } from './plugins/mention-kit';
|
||||||
import { SlashKit } from './plugins/slash-kit';
|
import { SlashKit } from './plugins/slash-kit';
|
||||||
|
@ -58,7 +58,7 @@ export const EditorKit = [
|
||||||
...MediaKit,
|
...MediaKit,
|
||||||
...CalloutKit,
|
...CalloutKit,
|
||||||
...ColumnKit,
|
...ColumnKit,
|
||||||
...MathKit,
|
// ...MathKit,
|
||||||
...DateKit,
|
...DateKit,
|
||||||
...LinkKit,
|
...LinkKit,
|
||||||
...MentionKit,
|
...MentionKit,
|
||||||
|
|
|
@ -201,6 +201,59 @@ Here's an unordered list:
|
||||||
expect((thirdElement as ParagraphElement).listStyleType).toBe('disc');
|
expect((thirdElement as ParagraphElement).listStyleType).toBe('disc');
|
||||||
expect(thirdElement.children[0]).toEqual({ text: 'Bullet list item 2' });
|
expect(thirdElement.children[0]).toEqual({ text: 'Bullet list item 2' });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('dollar sign', async () => {
|
||||||
|
const markdown = `Top performers balance volume and value across purchase contexts:
|
||||||
|
- **High-volume replacement parts** (1,088 orders, $16M revenue)
|
||||||
|
- **High-value maintenance & upgrade** (535 orders, $21.4M revenue)`;
|
||||||
|
|
||||||
|
const platejs = await markdownToPlatejs(markdown);
|
||||||
|
expect(platejs.error).toBeUndefined();
|
||||||
|
expect(platejs.elements).toBeDefined();
|
||||||
|
const firstElement = platejs.elements[0];
|
||||||
|
expect(firstElement.type).toBe('p');
|
||||||
|
expect(firstElement.children[0]).toEqual({
|
||||||
|
text: 'Top performers balance volume and value across purchase contexts:',
|
||||||
|
});
|
||||||
|
expect(platejs.elements).toEqual([
|
||||||
|
{
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
text: 'Top performers balance volume and value across purchase contexts:',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
type: 'p',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
bold: true,
|
||||||
|
text: 'High-volume replacement parts',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: ' (1,088 orders, $16M revenue)',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
type: 'p',
|
||||||
|
indent: 1,
|
||||||
|
listStyleType: 'disc',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
bold: true,
|
||||||
|
text: 'High-value maintenance & upgrade',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: ' (535 orders, $21.4M revenue)',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
type: 'p',
|
||||||
|
indent: 1,
|
||||||
|
listStyleType: 'disc',
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('platejsToMarkdown', () => {
|
describe('platejsToMarkdown', () => {
|
||||||
|
|
Loading…
Reference in New Issue