@zohodesk/react-cli 1.1.14-exp.3 → 1.1.14-kubernetes
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +16 -281
- package/bin/cli.js +55 -30
- package/docs/CustomChunks.md +9 -12
- package/docs/SelectorWeight.md +0 -3
- package/docs/ValueReplacer.md +0 -27
- package/docs/VariableConversion.md +1 -6
- package/lib/common/splitChunks.js +45 -65
- package/lib/common/testPattern.js +11 -9
- package/lib/common/valueReplacer.js +3 -1
- package/lib/configs/resolvers.js +5 -16
- package/lib/configs/webpack.css.umd.config.js +2 -3
- package/lib/configs/webpack.dev.config.js +5 -15
- package/lib/configs/webpack.docs.config.js +3 -14
- package/lib/configs/webpack.impact.config.js +2 -8
- package/lib/configs/webpack.prod.config.js +5 -15
- package/lib/constants.js +3 -3
- package/lib/loaderUtils/getCSSLoaders.js +49 -98
- package/lib/loaderUtils/windowsModification.js +1 -6
- package/lib/loaders/docsLoader.js +7 -18
- package/lib/loaders/selectorMappingLoader.js +9 -9
- package/lib/pluginUtils/getDevPlugins.js +6 -25
- package/lib/pluginUtils/getProdPlugins.js +5 -32
- package/lib/pluginUtils/getUMDCSSPlugins.js +1 -1
- package/lib/pluginUtils/getUMDComponentPlugins.js +1 -1
- package/lib/plugins/EFCPlugin.js +9 -9
- package/lib/plugins/EFCTemplatePlugin.js +12 -10
- package/lib/plugins/I18NInjectIntoIndexPlugin.js +9 -8
- package/lib/plugins/I18nSplitPlugin/I18nDebugPlugin.js +3 -2
- package/lib/plugins/I18nSplitPlugin/I18nDownlodLogic.js +13 -30
- package/lib/plugins/I18nSplitPlugin/I18nKeysIdentifer.js +7 -2
- package/lib/plugins/I18nSplitPlugin/index.js +1 -1
- package/lib/plugins/I18nSplitPlugin/utils/propertiesUtils.js +8 -8
- package/lib/plugins/ReportGeneratePlugin.js +6 -8
- package/lib/plugins/ResourceHintsPlugin.js +3 -13
- package/lib/plugins/SelectorPlugin.js +37 -77
- package/lib/plugins/{MinifyPlugin.js → UglifyCSSPlugin.js} +3 -3
- package/lib/plugins/UnusedFilesFindPlugin.js +5 -7
- package/lib/plugins/VariableConversionCollector.js +101 -40
- package/lib/plugins/composeCommonPlugin.js +30 -0
- package/lib/plugins/index.js +7 -7
- package/lib/postcss-plugins/ExcludePlugin.js +1 -1
- package/lib/postcss-plugins/RTLSplitPlugin.js +10 -4
- package/lib/postcss-plugins/ValueReplacer.js +29 -8
- package/lib/postcss-plugins/hoverActivePlugin.js +6 -0
- package/lib/postcss-plugins/variableModificationPlugin/ErrorHandler.js +1 -0
- package/lib/postcss-plugins/variableModificationPlugin/index.js +38 -94
- package/lib/postcss-plugins/variableModifier.js +244 -0
- package/lib/schemas/index.js +18 -94
- package/lib/servers/devBuild.js +11 -13
- package/lib/servers/getCliPath.js +5 -3
- package/lib/servers/httpsOptions.js +13 -12
- package/lib/servers/nowatchserver.js +55 -62
- package/lib/servers/server.js +52 -53
- package/lib/utils/cssClassNameGenerate.js +13 -70
- package/lib/utils/getOptions.js +28 -35
- package/lib/utils/getServerURL.js +9 -1
- package/lib/utils/index.js +12 -14
- package/lib/utils/initPreCommitHook.js +5 -5
- package/lib/utils/pullOrigin.js +3 -3
- package/lib/utils/reinstallDependencies.js +3 -3
- package/lib/utils/switchBranch.js +2 -4
- package/package.json +3 -5
- package/templates/docs/all.html +0 -1
- package/templates/docs/component.html +0 -1
- package/templates/docs/components.html +0 -1
- package/templates/docs/css/style.css +169 -136
- package/templates/docs/index.html +632 -796
- package/.vscode/settings.json +0 -25
- package/docs/ComposeMinification.md +0 -13
- package/docs/MarkdownParser.md +0 -18
- package/docs/ReactLive.md +0 -14
- package/docs/patternFiltering.md +0 -57
- package/lib/common/buildEs.js +0 -12
- package/lib/common/runPreProcess.js +0 -71
- package/lib/deprecationLogger.js +0 -40
- package/lib/loaderUtils/tests/windowsModification.test.js +0 -10
- package/lib/loaders/__test__/markdownLoader.spec.js +0 -145
- package/lib/loaders/composeLoader.js +0 -298
- package/lib/loaders/markdownLoader.js +0 -71
- package/lib/loaders/reactLiveConvertor.js +0 -105
- package/lib/logger.js +0 -27
- package/lib/plugins/CustomAttributePlugin.js +0 -82
- package/lib/plugins/CustomAttributePlugin.md +0 -35
- package/lib/plugins/EfcResourceCleanupPlugin.js +0 -43
- package/lib/plugins/StatsPlugin.js +0 -82
- package/lib/plugins/utils/classHandling.js +0 -35
- package/lib/plugins/utils/fileHandling.js +0 -92
- package/lib/plugins/utils/tests/fileHandling.test.js +0 -30
- package/lib/plugins/variableConvertorUtils.js +0 -133
- package/lib/postcss-plugins/EmptyPlugin.js +0 -8
- package/lib/postcss-plugins/IncludePlugin.js +0 -23
- package/lib/postcss-plugins/SelectorReplace.js +0 -80
- package/lib/postcss-plugins/__test__/selectorReplace.test.js +0 -28
- package/lib/postcss-plugins/__test__/valueReplacer.spec.js +0 -43
- package/lib/servers/requireLocalOrGlobal.js +0 -61
- package/lib/utils/deprecationSupport.js +0 -134
- package/lib/utils/log.js +0 -11
- package/lib/utils/object-manipulation.js +0 -88
- package/lib/utils/selectorReplacer.js +0 -47
- package/lib/utils/variableConverter.js +0 -104
- package/npm-shrinkwrap.json +0 -33485
- package/templates/docs/css/markdown.css +0 -202
package/.vscode/settings.json
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"cSpell.words": [
|
3
|
-
"classname",
|
4
|
-
"cmjs",
|
5
|
-
"devbuild",
|
6
|
-
"escodegen",
|
7
|
-
"expublish",
|
8
|
-
"gitclone",
|
9
|
-
"hgclone",
|
10
|
-
"mockapi",
|
11
|
-
"mockserver",
|
12
|
-
"nowatchserver",
|
13
|
-
"nowatchstart",
|
14
|
-
"postpublish",
|
15
|
-
"propertytojson",
|
16
|
-
"sslcert",
|
17
|
-
"sslcertupdate",
|
18
|
-
"sstest",
|
19
|
-
"uglifycss",
|
20
|
-
"valuereplacer",
|
21
|
-
"xmlhttprequest",
|
22
|
-
"zohodesk",
|
23
|
-
"zsecurity"
|
24
|
-
]
|
25
|
-
}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
# Compose Minification
|
2
|
-
|
3
|
-
We use this plugin to extract all the common attributes ( margin, padding... ) supported and write them in respective common files( margin.css, padding.css... ) These are further reference to the classname instead of a line of code by composing and adding classnames for the same.
|
4
|
-
|
5
|
-
|
6
|
-
# Feature :
|
7
|
-
|
8
|
-
* We can enable this plugin by representing the value of ` react-cli > app > plugins > composeMinification ` to `true`.
|
9
|
-
* The creation of `margin.css`, `padding.css`, `position.css` and so on will be done initially by a manual script for the application.
|
10
|
-
* Further the `composeMinification` plugin converts the `props` of common attributes under check into `compose` and `values` into `compose format` ( m10 from `../margin.css`)
|
11
|
-
* On runtime the conversion takes place and classnames for the properties (`margin`, `padding`, so on...) are added with references to respective files and styles are applied.
|
12
|
-
|
13
|
-
|
package/docs/MarkdownParser.md
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
|
2
|
-
----> markdownParser <----
|
3
|
-
|
4
|
-
1. Markdown parser allows us to write Documentation using Markdown language inside the Javascript file
|
5
|
-
2. This will converts the snippets to HTML tag.
|
6
|
-
3. We can implement this only inside the particular syntax which is metioned below.
|
7
|
-
4. We can enable/disable this feature by `npm run docs --markdown_parser=true/false` default value will be `true`.
|
8
|
-
5. Also we can enable/disable this feature by adding `enableMDParser` key inside the package.json under the `docs`.
|
9
|
-
|
10
|
-
### syntax
|
11
|
-
```
|
12
|
-
/* MD:START
|
13
|
-
# Hello World
|
14
|
-
MD:END */
|
15
|
-
```
|
16
|
-
|
17
|
-
# v1.1.7 update:
|
18
|
-
* Markdown Parser feature implemented.
|
package/docs/ReactLive.md
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
|
2
|
-
----> ReactLive <----
|
3
|
-
|
4
|
-
1. React Live is a live playground for reactjs (For now we have implemented in our docs)
|
5
|
-
2. So, for this we are using reactLiveConverter.js (src/loaders) to convert the file format.
|
6
|
-
3. We can enable/disable this feature by `npm run docs --enableReactLive=true/false` default value will be `true`.
|
7
|
-
4. Also we can enable/disable this feature by adding `enableReactLive` key inside the package.json under the `docs`.
|
8
|
-
|
9
|
-
# v1.1.0 update:
|
10
|
-
* ReactLive feature implemented.
|
11
|
-
|
12
|
-
# v1.1.2 update:
|
13
|
-
|
14
|
-
* ReactLiveConverter filepath changed to 'reactLiveConverter.js' in docLoader file
|
package/docs/patternFiltering.md
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
# Pattern filtering
|
2
|
-
|
3
|
-
As replacement for exclude we now have patterns in place of exclude to include or exclude a file based on its name in package.json.
|
4
|
-
|
5
|
-
|
6
|
-
# Example for patterns :
|
7
|
-
|
8
|
-
**Old System** :
|
9
|
-
To exclude `node_modules` folder from convertion for the `cssVariableReplacement` plugin, we used to have :
|
10
|
-
|
11
|
-
`react-cli > app > exclude > cssVariableReplacement` as ['node_modules'] in `package.json`
|
12
|
-
|
13
|
-
Example :
|
14
|
-
|
15
|
-
"exclude": {
|
16
|
-
"cssVariableReplacement": [
|
17
|
-
"node_modules"
|
18
|
-
]
|
19
|
-
},
|
20
|
-
|
21
|
-
**New System** :
|
22
|
-
|
23
|
-
To include all files for convertion for the `valueReplacer` plugin, we now have :
|
24
|
-
|
25
|
-
`react-cli > app > patterns > valueReplacer` as ['*'] in `package.json`
|
26
|
-
|
27
|
-
To include `src` files for convertion for the `cssVariableReplacement` plugin, we now have :
|
28
|
-
|
29
|
-
`react-cli > app > patterns > hoverActive` as ['src'] in `package.json`
|
30
|
-
|
31
|
-
To exclude `node_modules` files for convertion for the `hoverActive` plugin, we now have :
|
32
|
-
|
33
|
-
`react-cli > app > patterns > cssVariableReplacement` as ['!node_modules'] in `package.json`
|
34
|
-
Here the `!` denotes that the folder structure/file is not to be converted.
|
35
|
-
|
36
|
-
Example :
|
37
|
-
|
38
|
-
"patterns": {
|
39
|
-
"valueReplacer": [
|
40
|
-
"*"
|
41
|
-
],
|
42
|
-
"hoverActive": [
|
43
|
-
"src"
|
44
|
-
],
|
45
|
-
"cssVariableReplacement": [
|
46
|
-
"!node_modules"
|
47
|
-
],
|
48
|
-
},
|
49
|
-
|
50
|
-
Note :
|
51
|
-
`patterns` also added support for cssUniqueness to be applied to selective files.
|
52
|
-
|
53
|
-
"patterns" : {
|
54
|
-
"cssUniqueness": [
|
55
|
-
"*"
|
56
|
-
],
|
57
|
-
}
|
package/lib/common/buildEs.js
DELETED
@@ -1,71 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.runPreProcess = runPreProcess;
|
7
|
-
|
8
|
-
var _path = _interopRequireWildcard(require("path"));
|
9
|
-
|
10
|
-
var _fs = require("fs");
|
11
|
-
|
12
|
-
var _child_process = require("child_process");
|
13
|
-
|
14
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
15
|
-
|
16
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
17
|
-
|
18
|
-
function runPreProcess({
|
19
|
-
options,
|
20
|
-
option,
|
21
|
-
nodemon,
|
22
|
-
spawnSync
|
23
|
-
}) {
|
24
|
-
const {
|
25
|
-
preprocess
|
26
|
-
} = options;
|
27
|
-
const preprocessorPath = preprocess.runner ? _path.default.join(process.cwd(), preprocess.runner) : '';
|
28
|
-
const preprocessCli = preprocess.stopNodemon ? 'node' : nodemon;
|
29
|
-
|
30
|
-
if (preprocessorPath && (0, _fs.existsSync)(preprocessorPath)) {
|
31
|
-
const preprocessorDirPath = (0, _path.dirname)(preprocessorPath);
|
32
|
-
const watchOptions = preprocessCli === nodemon ? ['--watch', preprocessorDirPath] : []; // eslint-disable-next-line default-case
|
33
|
-
|
34
|
-
switch (option) {
|
35
|
-
case 'start':
|
36
|
-
case 'docs':
|
37
|
-
(0, _child_process.spawn)(preprocessCli, [preprocessorPath, ...watchOptions], {
|
38
|
-
stdio: 'inherit',
|
39
|
-
cwd: preprocessorDirPath
|
40
|
-
}); // NOTE: it's ok if we not close this here
|
41
|
-
// Because when node server stops this program will be closed So this nodemon will be killed as well
|
42
|
-
|
43
|
-
break;
|
44
|
-
|
45
|
-
case 'nowatchstart':
|
46
|
-
case 'devbuild':
|
47
|
-
case 'build:library:es':
|
48
|
-
case 'build:component:es':
|
49
|
-
case 'build:library:cmjs':
|
50
|
-
case 'build:component:cmjs':
|
51
|
-
spawnSync('node', [preprocessorPath], {
|
52
|
-
stdio: 'inherit',
|
53
|
-
cwd: preprocessorPath.slice(0, preprocessorPath.lastIndexOf('/') + 1)
|
54
|
-
});
|
55
|
-
break;
|
56
|
-
|
57
|
-
case 'preprocessor':
|
58
|
-
{
|
59
|
-
const result = spawnSync(preprocessCli, [preprocessorPath, ...watchOptions], {
|
60
|
-
stdio: 'inherit',
|
61
|
-
cwd: preprocessorDirPath
|
62
|
-
});
|
63
|
-
process.exit(result.status);
|
64
|
-
break;
|
65
|
-
}
|
66
|
-
}
|
67
|
-
} else if (option === 'preprocess') {
|
68
|
-
console.error(`preProcessor not exists ${preprocessorPath}`);
|
69
|
-
process.exit(0);
|
70
|
-
}
|
71
|
-
}
|
package/lib/deprecationLogger.js
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.deprecateMessage = deprecateMessage;
|
7
|
-
exports.deprecateOption = deprecateOption;
|
8
|
-
exports.deprecationLoggerEnd = deprecationLoggerEnd;
|
9
|
-
|
10
|
-
var _logger = require("./logger");
|
11
|
-
|
12
|
-
function deprecateMessage(message) {
|
13
|
-
// eslint-disable-next-line no-use-before-define
|
14
|
-
deprecationLoggerStart();
|
15
|
-
(0, _logger.messageLogger)('\x1b[36m%s\x1b[0m', message);
|
16
|
-
}
|
17
|
-
|
18
|
-
function printLine() {
|
19
|
-
deprecateMessage('\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! \n ');
|
20
|
-
}
|
21
|
-
|
22
|
-
let isFirstDeprecation = false;
|
23
|
-
|
24
|
-
function deprecateOption(previousObjPath = '', newObjPath = '', message = '') {
|
25
|
-
deprecateMessage(`Please move "${previousObjPath.split('.').join(' > ')}" to "${newObjPath.split('.').join(' > ')}" following option ${message}`);
|
26
|
-
}
|
27
|
-
|
28
|
-
function deprecationLoggerStart() {
|
29
|
-
if (!isFirstDeprecation) {
|
30
|
-
isFirstDeprecation = true;
|
31
|
-
printLine();
|
32
|
-
}
|
33
|
-
}
|
34
|
-
|
35
|
-
function deprecationLoggerEnd() {
|
36
|
-
if (isFirstDeprecation) {
|
37
|
-
isFirstDeprecation = false;
|
38
|
-
printLine();
|
39
|
-
}
|
40
|
-
}
|
@@ -1,10 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
const {
|
4
|
-
windowsModificationFile
|
5
|
-
} = require('../windowsModification');
|
6
|
-
|
7
|
-
const tests = ['D:\\MyWork\\React Build\\desk_client_app\\jsapps\\supportapp\\src\\components\\Accessibility\\Accessibility.module.css', 'D:/MyWork/React Build/desk_client_app/jsapps/supportapp/src/components/Accessibility/Accessibility.module.css', 'desk_client_app\\jsapps\\supportapp\\src\\components\\Accessibility\\Accessibility.module.css', 'desk_client_app/jsapps/supportapp/src/components/Accessibility/Accessibility.module.css', 'src\\components\\Accessibility\\Accessibility.module.css', 'src/components/Accessibility/Accessibility.module.css', 'Accessibility.module.css', ''];
|
8
|
-
tests.forEach(test => {
|
9
|
-
console.log(windowsModificationFile(test));
|
10
|
-
});
|
@@ -1,145 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
const {
|
4
|
-
markdownParser
|
5
|
-
} = require('../markdownLoader'); // Replace './your-file' with the correct file path
|
6
|
-
|
7
|
-
|
8
|
-
describe('markdownParser', () => {
|
9
|
-
test('For {}(braces) case', () => {
|
10
|
-
const source = `
|
11
|
-
/* MD:START
|
12
|
-
# {Hi, This is Test Case :)}
|
13
|
-
MD:END */
|
14
|
-
`;
|
15
|
-
const expectedOutput = `
|
16
|
-
<><div class="markDown"><h1>{Hi, This is Test Case :)}</h1>
|
17
|
-
</div></>
|
18
|
-
`;
|
19
|
-
expect(markdownParser(source)).toEqual(expectedOutput);
|
20
|
-
});
|
21
|
-
test('For $ (dollor) case', () => {
|
22
|
-
const source = `
|
23
|
-
/* MD:START
|
24
|
-
# $Hi, This is Test Case :)
|
25
|
-
MD:END */
|
26
|
-
`;
|
27
|
-
const expectedOutput = `
|
28
|
-
<><div class="markDown"><h1>$Hi, This is Test Case :)</h1>
|
29
|
-
</div></>
|
30
|
-
`;
|
31
|
-
expect(markdownParser(source)).toEqual(expectedOutput);
|
32
|
-
});
|
33
|
-
test('For All kind of Tag Cases', () => {
|
34
|
-
const source = `
|
35
|
-
/* MD:START
|
36
|
-
# Markdown File with Variety of Data
|
37
|
-
|
38
|
-
## Text
|
39
|
-
|
40
|
-
This is a paragraph of text.
|
41
|
-
|
42
|
-
## Headings
|
43
|
-
|
44
|
-
### Heading 1
|
45
|
-
|
46
|
-
### Heading 2
|
47
|
-
|
48
|
-
#### Heading 2.1
|
49
|
-
|
50
|
-
#### Heading 2.2
|
51
|
-
|
52
|
-
## Lists
|
53
|
-
|
54
|
-
### Unordered List
|
55
|
-
|
56
|
-
- Item 1
|
57
|
-
- Item 2
|
58
|
-
- Item 3
|
59
|
-
|
60
|
-
### Ordered List
|
61
|
-
|
62
|
-
1. First item
|
63
|
-
2. Second item
|
64
|
-
3. Third item
|
65
|
-
|
66
|
-
## Links
|
67
|
-
|
68
|
-
Here's a link to [OpenAI's website](https://openai.com).
|
69
|
-
|
70
|
-
## Images
|
71
|
-
|
72
|
-
![Markdown Logo](https://upload.wikimedia.org/wikipedia/commons/4/48/Markdown-mark.svg)
|
73
|
-
|
74
|
-
## Tables
|
75
|
-
|
76
|
-
| Name | Age | Gender |
|
77
|
-
|-------|-----|--------|
|
78
|
-
| John | 25 | Male |
|
79
|
-
| Sarah | 30 | Female |
|
80
|
-
| Mark | 35 | Male |
|
81
|
-
|
82
|
-
MD:END */
|
83
|
-
`;
|
84
|
-
const expectedOutput = `
|
85
|
-
<><div class="markDown"><h1>Markdown File with Variety of Data</h1>
|
86
|
-
<h2>Text</h2>
|
87
|
-
<p>This is a paragraph of text.</p>
|
88
|
-
<h2>Headings</h2>
|
89
|
-
<h3>Heading 1</h3>
|
90
|
-
<h3>Heading 2</h3>
|
91
|
-
<h4>Heading 2.1</h4>
|
92
|
-
<h4>Heading 2.2</h4>
|
93
|
-
<h2>Lists</h2>
|
94
|
-
<h3>Unordered List</h3>
|
95
|
-
<ul>
|
96
|
-
<li>Item 1</li>
|
97
|
-
<li>Item 2</li>
|
98
|
-
<li>Item 3</li>
|
99
|
-
</ul>
|
100
|
-
<h3>Ordered List</h3>
|
101
|
-
<ol>
|
102
|
-
<li>First item</li>
|
103
|
-
<li>Second item</li>
|
104
|
-
<li>Third item</li>
|
105
|
-
</ol>
|
106
|
-
<h2>Links</h2>
|
107
|
-
<p>Here's a link to <a href="https://openai.com">OpenAI's website</a>.</p>
|
108
|
-
<h2>Images</h2>
|
109
|
-
<p><img src="https://upload.wikimedia.org/wikipedia/commons/4/48/Markdown-mark.svg" alt="Markdown Logo"/></p>
|
110
|
-
<h2>Tables</h2>
|
111
|
-
<table>
|
112
|
-
<thead>
|
113
|
-
<tr>
|
114
|
-
<th>Name</th>
|
115
|
-
<th>Age</th>
|
116
|
-
<th>Gender</th>
|
117
|
-
</tr>
|
118
|
-
</thead>
|
119
|
-
<tbody>
|
120
|
-
<tr>
|
121
|
-
<td>John</td>
|
122
|
-
<td>25</td>
|
123
|
-
<td>Male</td>
|
124
|
-
</tr>
|
125
|
-
<tr>
|
126
|
-
<td>Sarah</td>
|
127
|
-
<td>30</td>
|
128
|
-
<td>Female</td>
|
129
|
-
</tr>
|
130
|
-
<tr>
|
131
|
-
<td>Mark</td>
|
132
|
-
<td>35</td>
|
133
|
-
<td>Male</td>
|
134
|
-
</tr>
|
135
|
-
</tbody>
|
136
|
-
</table>
|
137
|
-
</div></>
|
138
|
-
`;
|
139
|
-
expect(markdownParser(source)).toEqual(expectedOutput);
|
140
|
-
});
|
141
|
-
test('For Source null case', () => {
|
142
|
-
expect(markdownParser(null)).toEqual('');
|
143
|
-
expect(markdownParser('')).toEqual('');
|
144
|
-
});
|
145
|
-
});
|