mde / ejs

Embedded JavaScript templates -- http://ejs.co

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it possible to encode in hexadecimal ?

bacloud23 opened this issue · comments

commented

I'm rendering some URLs and after running some HTML validators, they point to "impermissible" values in URLs.
It is multilanguage website so these are expected:

  • href="http://domain.com/ééééé.html" (accent)
  • href="http://domain.com/hello world.html" (white-space)
  • href="http://domain.com/منزل.html" (non-latin)

Thank you 👍🏻

This doesn't seem like an EJS-specific question, but — seems possible that older validators might not handle these values correctly. In any case, I would likely encode these values using the usual encodeURIComponent, which would output values that you could use with confidence everywhere.

Thank you so much for providing that option. I didn't know about that.