Skip to content

Commit 1f74f80

Browse files
committed
fix(parser): allow # character in values
Stip inline comments whenever there is a # character. It does not allow to use it as a value in values then. Inline comments are not started with a blank space followed by the # character.
1 parent a249916 commit 1f74f80

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export class Parser {
109109
* @param value - the value to strip comments from
110110
*/
111111
stripComments(value: string): string {
112-
let values = value.split('#');
112+
let values = value.split(' #');
113113
return values[0].trim();
114114
}
115115

test/unit/parser.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ describe('the parser', () => {
5252
sut.doParse(`ENV1=value3#test\nENV2=value2 # test\nENV3=value1 #test`);
5353

5454
let expected = {
55-
ENV1: 'value3',
55+
ENV1: 'value3#test',
5656
ENV2: 'value2',
5757
ENV3: 'value1'
5858
};

0 commit comments

Comments
 (0)