-
Notifications
You must be signed in to change notification settings - Fork 113
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
#26, words did not get highlighted correctly in rich editors. #29
base: master
Are you sure you want to change the base?
#26, words did not get highlighted correctly in rich editors. #29
Conversation
…s. The first and last words in the elements did not get highlighted correctly.
Thanks for this, I've merged this change into the develop branch. (In the future, please target the develop branch when submitting pull requests.) I'm going to make some changes to this code. As you've figured out, the issue here is the lack of whitespace in the markup. I've tried my best to avoid managing whitespace but it's pretty clear now I have to accommodate the lack of whitespace in a DOM tree. The issue:
It's difficult to know if the It's difficult to extract text from markup when styles influence how words are broken.
I'll update this ticket with my changes soon... |
…fix for processing markup without whitespace between nodes by comparing node display style refs #29
Please can you test my change with the latest code from the develop branch? Or you can just use this version to test: https://github.com/badsyntax/jquery-spellchecker/blob/develop/dist/js/jquery.spellchecker.js |
It looks good, the tests passed. I will not be able to test it within our code base yet due to that we are in a regression test phase, but we will merge it for our next release. |
This needs more work. My approach is wrong, I think. We can't test for styles because block !== newline (eg, if an element is block and floated). I will follow what CKEditor does. CKeditor parses and transforms markup. I will try understand how CKEditor does this and then apply the same logic. I believe most of the logic you can find here: http://docs.ckeditor.com/source/htmldataprocessor.html possibly within the createBogusAndFillerRules() and isBlockBoundary() functions. I spoke with some of the core devs a little while back about handling the lack of whitespace here: http://dev.ckeditor.com/ticket/9578 Their responses suggest they assume certain elements to be block and thus require new line whitespace. |
I've gone back to simply comparing the nodeName to a list of known block level element with commit: ee51122 This seems to have fixed a lot of the issues. Once I get some more testing done I will release this and other fixes as v0.2.5 |
No description provided.