Skip to content
This repository has been archived by the owner on Jun 10, 2018. It is now read-only.

Coerce null/undefined to empty string when escaping #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Coerce null/undefined to empty string when escaping #16

wants to merge 1 commit into from

Conversation

emma-borhanian
Copy link

When you use escape tags with a null value it will be turned into the string "null", which can be incredibly inconvenient.

For example

value: "<%- null %>"

becomes

value: "null"

This patch changes the result to:

value: ""

This is consistent with the behavior of e.g. erb

@jfredett
Copy link

👍 this effects my project as well, and would be a very convenient change

@fxposter
Copy link

Why not extract the escaping function and put it with the print one? It would be better to have one function instead of a lot of the same ones.

@emma-borhanian
Copy link
Author

I was planning on making a follow-up pull request to perform that optimization, and also apply it to the "escape_function" at the same time.

Unfortunately it looks like this project is dead.

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

Successfully merging this pull request may close these issues.

3 participants