The Wayback Machine - https://web.archive.org/web/20201126092509/https://github.com/leetcode-tools/leetcode-cli/pull/23
Skip to content
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

add file.codeData to extract user code #23

Merged
merged 3 commits into from Sep 17, 2019
Merged

Conversation

@@ -15,4 +15,6 @@ ${comment.line} Testcase Example: ${testcase}
${comment.line}
{{ desc.forEach(function(x) { }}${comment.line} ${x}
{{ }) }}${comment.end}
${comment.singleLine} @lc code=start

This comment has been minimized.

@jdneo

jdneo Sep 16, 2019

I'm thinking that adding a single empty line between the block comments and the single line comments. Because in some of the languages the comments styles are different.

Besides they belongs to different section.

What do you think?

This comment has been minimized.

@magic-akari

magic-akari Sep 16, 2019
Author

Yes, adding a single empty line is better.

lib/file.js Outdated
const end = lines.findIndex(x => x.indexOf('@lc code=end') !== -1);

if (start !== -1 && end !== -1 && start + 1 <= end) {
return lines.slice(start + 1, end).join(this.isWindows() ? '\r\n' : '\n');

This comment has been minimized.

@jdneo

jdneo Sep 16, 2019

this.isWindows() ? '\r\n' : '\n'

Use os.EOL instead.

This comment has been minimized.

@jdneo
jdneo approved these changes Sep 17, 2019
@jdneo jdneo merged commit b361581 into leetcode-tools:master Sep 17, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@jdneo
Copy link

@jdneo jdneo commented Sep 17, 2019

Thanks @magic-akari !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.