-
Notifications
You must be signed in to change notification settings - Fork 0
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
[CLOSED] Fix for Issue 3339 #3140
Comments
Also added fixes for two other cases |
|
unit tests will be added in a separate pull after this got merged. |
We should really add unit tests here too -- both for some entity hinting cases and for the tag hinting cases that are currently broken (and which the existing tag hinting tests haven't caught). |
Oops sorry, just saw the above note about adding unit tests later. Ideally we like to do it all in one pull request, but this seems ok since we definitely need to get the fix part landed ASAP before sprint end. |
thats what i thougth ;) |
Although you haven't changed it in this pull request, I just noticed this function:
There's no need to search for "#" because replace will do nothing if it's not found:
Question: Why is the semi-colon (;) not also encoded since it is decoded in the associated _decodeValue() function? In general, encode/decode functions should do the exact opposite of each other. |
Please don't push any changes until I say "review is complete". I'm looking at the code in both the github pull request diff and in Brackets, so it's making it difficult for me to keep them in sync. Thanks. |
sorry i'll certainly do so. function _encodeValue(value) {
return value.replace("&", "&").replace("#", "#").replace(";", ";");
} we would break the whole functionality because the replace would replace the semi-colons from the previous entities. function _encodeValue(value) {
return value.replace("&", "&").replace(";", ";").replace("#", "#");
} the hash of the semi-colon entity would be replaced. |
Regarding "encoding the semi-colon": Unfortunately, it's not easy to do, but, if it's required, you just have to be smarter about it. In this code, I don't think it's required because |
Done with initial review. |
actually |
|
In the sorting function, I noticed this after I merged the original code: this line of code:
Can be simplified to:
This is because sort functions aren't limited to returning only -1, 0, or 1. They just need to return 0 if equal, or a positive or negative number to indicate greater than or less than. |
Done with second review. |
|
Looks good. Merging. |
Thursday Apr 04, 2013 at 07:52 GMT
Originally opened as adobe/brackets#3340
Fix #3339
WebsiteDeveloper included the following code: https://github.com/adobe/brackets/pull/3340/commits
The text was updated successfully, but these errors were encountered: