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

fix encodeHTMLSource when code = 0 #178

Closed
wants to merge 1 commit into from

Conversation

hustxiaoc
Copy link

when encodeHTMLSource got a parameter code = 0, encodeHTMLSource will output '' , but the expected output is
'0'

when encodeHTMLSource got a parameter  code = 0,  encodeHTMLSource will output  ''  , but the expected  output  is
'0'
@crzidea
Copy link

crzidea commented Dec 4, 2015

I have same issue on this. But it shouldn't just be compared with undefined.
This will cause exception when variable was null:

> null.toString()
Uncaught TypeError: Cannot read property 'toString' of null(…)

Related PR: #183

@houd1ni
Copy link

houd1ni commented Apr 20, 2016

feel free to reopen #191 due to maintain issues with this fork

@epoberezkin
Copy link
Collaborator

@hustxiaoc please see #183 (comment)

Either of the PRs can be merged after those changes, let me know if you would like to do it.

sgruetter added a commit to sgruetter/doT that referenced this pull request Dec 17, 2018
This change fixes an issue where falsy values (i.e. false, null,
undefined, 0, NaN) lead to an empty string. All of these values except
undefined are now stringified when rendering with {{! }} to have them
rendered. undefined continues to lead to an empty string to avoid
introduce many issues with existing usages.

Fixes olado#274, olado#170, olado#178, olado#183.
@epoberezkin
Copy link
Collaborator

#274 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants