Fix lang/web's html entity encode/decode functions

Also, add unit tests and don't encode spaces.
This commit is contained in:
Henrik Lissner 2017-07-03 02:57:31 +02:00
parent 0f6884f9d6
commit 7477546892
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 26 additions and 8 deletions

View file

@ -0,0 +1,13 @@
;;; lang/web/test/autoload-html.el -*- lexical-binding: t; -*-
(def-test! encode-entities
(should (equal (+web-encode-entities "Hello world")
"Hello world"))
(should (equal (+web-encode-entities "H€llø wørld")
"H€llø wørld")))
(def-test! decode-entities
(should (equal (+web-decode-entities "Hello world")
"Hello world"))
(should (equal (+web-decode-entities "H€llø wørld")
"H€llø wørld")))