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

add file.codeData to extract user code #23

merged 3 commits into from
Sep 17, 2019

Conversation

magic-akari
Copy link

@@ -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
Copy link

@jdneo jdneo Sep 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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');
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Use os.EOL instead.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@jdneo jdneo merged commit b361581 into leetcode-tools:master Sep 17, 2019
@jdneo
Copy link

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants