-
Notifications
You must be signed in to change notification settings - Fork 861
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
JSHint support #65
JSHint support #65
Conversation
@@ -535,12 +537,12 @@ Markdown.dialects.Gruber = { | |||
// We have to grab all lines for a li and call processInline on them | |||
// once as there are some inline things that can span lines. | |||
var li_accumulate = ""; | |||
var nl = "", | |||
l = lines[line_no].replace(/^\n/, function(n) { nl = n; return ""; }); |
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.
This change will affect the behaviour, since it's no longer resetting nl
and calculating l
at the start of each loop.
In general, the changes look good and I'm in favour of them. There's a few I have issue with, most notably those that change the behaviour of the code! If you have the time and inclination to look at this in the next week that'd be great, otherwise I'll make the suggested modifications when I get a chance and merge it in. |
Hi. I'll improve the PR soon and cc you. |
cc @evilstreak. I added JSHint support properly. I also reverted the changes you commented. Please check .jshintrc and let me know if you want me to change anything. |
@XhmikosR Thanks for the update. When I check out your branch and run I only have one comment about |
@evilstreak: I have changed that just before you try it. Please check out the branch again. Personally, I'd like to have EDIT: Now the PR should be final. |
This pull request is starting to get a little busy! Tap 0.4.1 behaves oddly (no output by default, doesn't seem to run all the test files, and incredibly slow to exit after running tests) compared to the previous version I had installed (0.3.3 behaves as I'm used to). I'd like to investigate this further before updating the dependency. The changes to the README are in general fine, though the list item indentation change doesn't seem right (it's gone from 4-space indent to a 5-space indent). The changes to both Finally, I'm hesitant to add an In conclusion: I'd prefer multiple smaller (more focused!) pull requests over one large one. I think several of your changes are immediately pullable, or very close to pullable, and some are further off. I'd accept a pull request right now that consisted solely of the code improvement changes, without the changes to |
For tap, we can specify another version, but it's better to follow semver than using 0, or 1. For the Readme, no indentation is needed for the lists; I'd personally remove the indentation. We have browser: false in .jshintrc but for markdown.js browser is true. I think it's fine. The lint task is one with the code changes. Without it you have to do it randomly. The warnings are not so many, and with a few more tweaking they can be reduced more. I split the changes. The PR's are dependent so I will need to rebase if one is merged before merging the next one. |
I added a couple more commits. I'm not sure if this is the style you prefer, but now it's consistent by using brackets. Let me know your thoughts. |
@@ -482,7 +482,7 @@ test( "inline_link", function(t, md) { | |||
[ [ "link", { href: "url", title: "tit'le" }, "text" ], " after')" ], | |||
"inline link III" ); | |||
|
|||
t.equivalent( md.processInline( "[text](url \"title\")" ), | |||
t.equivalent( md.processInline( "[text](url 'title')" ), |
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.
This change and the one one line 454 is wrong.
If you desperately don't want \"
then change the whole thing to single quotes, not the double quote in the string to single quotes.
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.
I don't see it wrong. It gets rid of the unnecessary escape.
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.
You are changing the input to a test from (url "title")
to (url 'title')
- this is no longer testing the same thing.
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.
OK then, I'll revert this part when I manage to rebase against master.
I disagree with the re-indentation in 7ad51bd - indenting the entire file for the |
@XhmikosR could you rebase this pull request against master - I'm not quite sure which (if any?) parts of this have been included in other pull requests etc. Thanks! |
@ashb: now it should be ok. The indentation patch is now much smaller since I only changed the part that used 4 spaces instead of 2 like most of the code does. |
PR updated. |
Bump |
Apologies for letting this lie fallow for so long - we've been rather distracted with other things :( According to travis this branch is failing its tests while master is currently passing https://travis-ci.org/evilstreak/markdown-js/builds/9542984. The error rather confusing: Cannot call method 'replace' of undefined at /home/travis/build/evilstreak/markdown-js/lib/markdown.js line 393 We're we waiting on @evilstreak's (browser) test refactor for this or was that something else? |
@ashb: No worries, I understand you both are busy people. I noticed that the tests are failing, but since @evilstreak suggested to use tap @0.3.3 I cannot test things on Windows; it always failed for me. I need to use tap 0.4.3 to actually see the failed tests. EDIT: I can't see something wrong with my changes, but I'm missing something probably. Or it's the strict comparisons used. |
The issue with the failing tests seems to come from this. I removed for now until someone else has a look. EDIT: Travis still fails and the JSHint warnings must be related.
|
bump No 2... I haven't fixed the Travis failures; I'd rather one of you @evilstreak @ashb have a look. I'm pretty sure they are caused because of the undefined variables like As you can see JSHint isn't just for missing semicolons :P |
God we're awful at this open source development lark. Sorry. Good news is that evilstrak and I are planning on spending some time hacking next week - this will be one of the first things we look at. |
OK, good to hear that. Let me know if you need any changes in the PR. I decided to use JSHint's feature to load its config from package.json instead of using a separate file. |
Use `npm run check` or `npm run lint`.
Thanks - I didn't use most of the commits directly - a few commits I cherry picked, a few I just did differently. I've also added you to the contributors section in the package.json |
Thanks for looking into the PR. The thing with your way is that I dont show as the patch author... You could have told me if you wanted me to make any changes, but anyway I'm glad the PR is merged. |
No description provided.