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

Tag interpolation drops lexer plugins #3295

Closed
rhendric opened this issue Oct 6, 2020 · 0 comments · Fixed by #3296
Closed

Tag interpolation drops lexer plugins #3295

rhendric opened this issue Oct 6, 2020 · 0 comments · Fixed by #3296

Comments

@rhendric
Copy link
Contributor

rhendric commented Oct 6, 2020

Pug Version: 3.0.0

Node Version: 14.12.0

Input JavaScript Values

pug.renderFile('input.pug', {
  plugins: [{
    lex: {
      blank(lexer) {
        if (lexer.input[0] === '~') {
          lexer.tokens.push(lexer.tok('text', 'twiddle-dee-dee'));
          lexer.consume(1);
          lexer.incrementColumn(1);
          return true;
        }
      }
    }
  }]
});

Input Pug

p Look at #[~]

Expected HTML

<p>Look at twiddle-dee-dee</p>

Actual HTML

Error: Pug:1:13
  > 1| p Look at #[~]
-------------------^

unexpected text "~]"

Additional Comments

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 a pull request may close this issue.

1 participant