-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix weird performance issue #139
base: master
Are you sure you want to change the base?
Conversation
This breaks other untested code/cases ;( |
@sbstjn is this ready to merge? |
@@ -500,8 +500,12 @@ function concatFragments(fragments: Array<TextFragment>): TextFragment { | |||
let characterMeta: CharacterMetaSeq = Seq(); | |||
fragments.forEach((textFragment: TextFragment) => { | |||
text = text + textFragment.text; | |||
characterMeta = characterMeta.concat(textFragment.characterMeta); | |||
|
|||
if (!characterMeta.isSuperset(textFragment.characterMeta)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind explaining how this fixes the large parsing of HTML data?
This fix breaks parsing. For this input:
Notice the text
The bug this is trying to fix is in the |
Later: my fix does not work. |
But this patch does:
|
Roughtly following the suggestion here sstur#139
Hi,
Thanks for the great
react-rte
! We noticed a few performance issues with the underlyingdraft-js-import-html
anddraft-js-import-element
libraries. I tried to fix it for "our use case" and added tests that make sure large/weird HTML structures can be parsed.Existing tests still work fine 🎉
//cc @HenrikFricke