Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc95cea8

Browse files
committed
refsskygragon#134: remove whitespace on windows.
Signed-off-by: Eric Wang <skygragon@gmail.com>
1 parent168b0f4 commitc95cea8

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

‎lib/file.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ file.meta = function(filename) {
149149
line.split(' ').forEach(function(x){
150150
constv=x.split('=');
151151
if(v.length==2){
152-
m[v[0]]=v[1];
152+
m[v[0]]=v[1].trim();
153153
}
154154
});
155155

‎test/test_file.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,18 @@ describe('file', function() {
8181
assert.equal(meta.lang,'javascript');
8282
});
8383

84+
it('should meta ok with white space',function(){
85+
file.data=x=>[
86+
'/ *',
87+
' * @lc app=leetcode id=123\t \t lang=javascript\r',
88+
' * /'
89+
].join('\n');
90+
constmeta=file.meta('dummy');
91+
assert.equal(meta.app,'leetcode')
92+
assert.equal(meta.id,'123');
93+
assert.equal(meta.lang,'javascript');
94+
});
95+
8496
it('should meta ok within file name',function(){
8597
file.data=x=>[
8698
'/ *',

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp