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

safeHtml throwing ERROR: wrong type for value; expected string; got float64 #889

Closed
thomasmodeneis opened this issue Feb 10, 2015 · 4 comments

Comments

@thomasmodeneis
Copy link

Hi,

I have the following problem:

tst_float64.md

xyz blz bla 12.866.431; 27,3% xyz bla bla.

tst.html

{{ .tst64 | safeHtml }}

ERROR:

ERROR: 2015/02/10 Error while rendering page tst_float64.md: template: tst.html:32:59: executing "tst.html" at <safeHtml>: wrong type for value; expected string; got float64

Does anyone knows witch part should I look for possible solutions?
Thank you.

@bep
Copy link
Member

bep commented Feb 10, 2015

I don't know where to look for the problem ...

What's .tst64?

Apparently a float64.

Maybe printf could work around this, but safeHtml should maybe accept more than just strings.

@thomasmodeneis
Copy link
Author

.tst64 is just a field inside the .md file that contains a float64 in the middle of the string.
I will try printf as workaround when I get home, thanks for the tip.

@bep bep assigned bep and unassigned bep Apr 6, 2015
@bep
Copy link
Member

bep commented May 12, 2016

safeHTML now accepts "anything", including floats.

@github-actions
Copy link

github-actions bot commented Apr 6, 2022

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants