MM-32254 Update CommonMark and fix handling of deeply nested Markdown (#5148)

* MM-32254 Update commonmark.js fork from upstream

* MM-32254 Fix handling of partially rendered Markdown tree
This commit is contained in:
Harrison Healey 2021-02-01 13:31:05 -05:00 committed by GitHub
parent a659eb69d9
commit 63b0e6043f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 10 deletions

View file

@ -33,4 +33,15 @@ describe('Markdown', () => {
expect(wrapper.getElement()).toMatchSnapshot();
});
test('MM-32254 should not crash when given string with deeply nested asterisks', () => {
const props = {
...baseProps,
value: '**'.repeat(50) + 'test' + '**'.repeat(50) + 'test',
};
shallow(
<Markdown {...props}/>,
);
});
});

24
package-lock.json generated
View file

@ -12431,19 +12431,26 @@
"integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs="
},
"commonmark": {
"version": "github:mattermost/commonmark.js#f6ab98dede6ce4b4e7adea140ac77249bfb2d6ce",
"from": "github:mattermost/commonmark.js#f6ab98dede6ce4b4e7adea140ac77249bfb2d6ce",
"version": "github:mattermost/commonmark.js#d716e1c89e0a6721051df7bc74ad7683e1ae438f",
"from": "github:mattermost/commonmark.js#d716e1c89e0a6721051df7bc74ad7683e1ae438f",
"requires": {
"entities": "~ 1.1.1",
"mdurl": "~ 1.0.1",
"minimist": "~ 1.2.0",
"entities": "~2.0",
"mdurl": "~1.0.1",
"minimist": ">=1.2.2",
"string.prototype.repeat": "^0.2.0",
"xregexp": "4.1.1"
},
"dependencies": {
"entities": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/entities/-/entities-2.0.3.tgz",
"integrity": "sha512-MyoZ0jgnLvB2X3Lg5HqpFmn1kybDiIfEQmKzTb5apr51Rb+T3KdmMiqa70T+bhGnyv7bQ6WMj2QMHpGMmlrUYQ=="
}
}
},
"commonmark-react-renderer": {
"version": "github:mattermost/commonmark-react-renderer#3a2ac19cab725ad28b170fdc1d397dddedcf87eb",
"from": "github:mattermost/commonmark-react-renderer#3a2ac19cab725ad28b170fdc1d397dddedcf87eb",
"version": "github:mattermost/commonmark-react-renderer#81af294317ebe19b5cc195d7fbc4f4a58177854c",
"from": "github:mattermost/commonmark-react-renderer#81af294317ebe19b5cc195d7fbc4f4a58177854c",
"requires": {
"in-publish": "^2.0.0",
"lodash.assign": "^4.2.0",
@ -13920,7 +13927,8 @@
"entities": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz",
"integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w=="
"integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==",
"dev": true
},
"envinfo": {
"version": "7.7.3",

View file

@ -18,8 +18,8 @@
"@rudderstack/rudder-sdk-react-native": "1.0.4",
"@sentry/react-native": "2.1.0",
"analytics-react-native": "1.2.0",
"commonmark": "github:mattermost/commonmark.js#f6ab98dede6ce4b4e7adea140ac77249bfb2d6ce",
"commonmark-react-renderer": "github:mattermost/commonmark-react-renderer#3a2ac19cab725ad28b170fdc1d397dddedcf87eb",
"commonmark": "github:mattermost/commonmark.js#d716e1c89e0a6721051df7bc74ad7683e1ae438f",
"commonmark-react-renderer": "github:mattermost/commonmark-react-renderer#81af294317ebe19b5cc195d7fbc4f4a58177854c",
"core-js": "3.8.2",
"deep-equal": "2.0.5",
"deepmerge": "4.2.2",