Skip to content

Commit

Permalink
fix: make second parameter optional on lexer.inline (#2552)
Browse files Browse the repository at this point in the history
* fix: make second parameter optional on lexer.inline

* return tokens

* add test
  • Loading branch information
UziTech authored Aug 21, 2022
1 parent eb35814 commit f1a9608
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/Lexer.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,9 @@ export class Lexer {
return tokens;
}

inline(src, tokens) {
inline(src, tokens = []) {
this.inlineQueue.push({ src, tokens });
return tokens;
}

/**
Expand Down
3 changes: 1 addition & 2 deletions test/unit/marked-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,11 +433,10 @@ describe('use extension', () => {
const token = {
type: 'walkableDescription',
raw: match[0],
dt: [],
dt: this.lexer.inline(match[1].trim()),
dd: [],
tokens: []
};
this.lexer.inline(match[1].trim(), token.dt);
this.lexer.inline(match[2].trim(), token.dd);
this.lexer.inline('unwalked', token.tokens);
return token;
Expand Down

1 comment on commit f1a9608

@vercel
Copy link

@vercel vercel bot commented on f1a9608 Aug 21, 2022

Choose a reason for hiding this comment

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

Please sign in to comment.