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

Bigints are parsed incorrectly resulting in escaped double quotes #3437

Open
NihilumPlays opened this issue May 24, 2024 · 0 comments
Open

Comments

@NihilumPlays
Copy link

Pug Version: 3.0.2

Node Version: 18.17.1

Input JavaScript Values

pug.renderFile('input.pug', {
  whatIsIt: BigInt(10),
});

Input Pug

html
	body
		input(type='hidden' value=whatIsIt)

Expected HTML

<html>
	<body>
		<input type="hidden" value="10"/>
	</body>
</html>

Actual HTML

<html>
	<body>
		<input type="hidden" value="&quot;10&quot;"/>
	</body>
</html>

Additional Comments

Not sure if this is intended behaviour and I'm just passing the BigInts incorrectly or if it's an actual bug. If this is intended please show me how it should be done correctly

As a workaround I'm using .toString() on every bigint value before I'm passing them which seems to work.

I'm using Express with the pug view engine so I'm not sure if this is an Express error or pug. If it's Express I'll post it to their github instead

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

No branches or pull requests

1 participant