Fix lang/web's html entity encode/decode functions
Also, add unit tests and don't encode spaces.
This commit is contained in:
parent
0f6884f9d6
commit
7477546892
2 changed files with 26 additions and 8 deletions
13
modules/lang/web/test/autoload-html.el
Normal file
13
modules/lang/web/test/autoload-html.el
Normal 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")))
|
Loading…
Add table
Add a link
Reference in a new issue