-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfixtures.ts
48 lines (42 loc) · 1.6 KB
/
fixtures.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { DiMarkdown } from 'react-icons/di';
import { createElement } from 'react';
import { ReferenceRenderFunction } from '../src';
export const mixedInlineStylesFixture =
'This is *emphasized*, **strong**, *emphasized with* **a break of strong** *in the middle*, **strong with** *a break of emphasized* **in the middle**, ***strong within** emphasized*, ***emphasized within* strong** and ***both***!';
export const diverseInlineStylesFixtureList = [
'*emphasized*',
'**strong**',
'*emphasized with* **a break of strong** *in the middle*',
'**strong with** *a break of emphasized* **in the middle**',
'***strong within** emphasized*',
'***emphasized within* strong**',
'**strong with *a bit of emphasized***',
'*emphasized with **a bit of strong***',
'***both***',
];
export const referenceLinkFixture = {
text: 'For wider markdown support, [check **markdown-to-jsx** out][1]!',
references: { '1': 'https://www.npmjs.com/package/markdown-to-jsx' },
};
const RenderMarkdownIcon: ReferenceRenderFunction = (children) =>
createElement(DiMarkdown, {
title: String(children),
style: { verticalAlign: 'middle' },
});
const RenderGreetingButton: ReferenceRenderFunction = (children) =>
createElement(
'button',
{
onClick: () => {
alert('Hello!');
},
},
children,
);
export const customComponentsFixture = {
text: 'Use references to render custom components like an **icon** ([markdown icon][md-icon]) or even a **button**: [*Howdie*][greeting-button]',
references: {
'md-icon': RenderMarkdownIcon,
'greeting-button': RenderGreetingButton,
},
};