Skip to content

Commit f1a9608

Browse files
authoredAug 21, 2022
fix: make second parameter optional on lexer.inline (#2552)
* fix: make second parameter optional on lexer.inline * return tokens * add test
1 parent eb35814 commit f1a9608

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

‎src/Lexer.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,9 @@ export class Lexer {
316316
return tokens;
317317
}
318318

319-
inline(src, tokens) {
319+
inline(src, tokens = []) {
320320
this.inlineQueue.push({ src, tokens });
321+
return tokens;
321322
}
322323

323324
/**

‎test/unit/marked-spec.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -433,11 +433,10 @@ describe('use extension', () => {
433433
const token = {
434434
type: 'walkableDescription',
435435
raw: match[0],
436-
dt: [],
436+
dt: this.lexer.inline(match[1].trim()),
437437
dd: [],
438438
tokens: []
439439
};
440-
this.lexer.inline(match[1].trim(), token.dt);
441440
this.lexer.inline(match[2].trim(), token.dd);
442441
this.lexer.inline('unwalked', token.tokens);
443442
return token;

1 commit comments

Comments
 (1)

vercel[bot] commented on Aug 21, 2022

@vercel[bot]
Please sign in to comment.