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

Template containing NULL character fails to evaluate #2059

Open
milankonir opened this issue Dec 30, 2024 · 0 comments
Open

Template containing NULL character fails to evaluate #2059

milankonir opened this issue Dec 30, 2024 · 0 comments
Labels

Comments

@milankonir
Copy link

Templates with NULL Unicode character(s) fail to evaluate

Example code:

import Handlebars from "https://esm.sh/handlebars";

const handlebars = Handlebars.create();
const template = handlebars.compile('Hello \x00 {{name}}')
try {
  const test = template({name: "foo"})
  console.log(test)
} catch (e) {
  console.log(e.message)
}

Fails with:

"Lexical error on line 1. Unrecognized text.
Hello  {{name}}
------^"

Codepen: https://codepen.io/Milan-Konir/pen/KwPXgbo?editors=1111

@jaylinski jaylinski added the bug label Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants