HTML entities decoding/encoding
Written for Lua5.3 but working with lua5.x!
- Fast!
- No dependencies!
- Easy to implement!
Module available through the LuaRocks. It can be installed using the luarocks
command line tools.
# LuaRocks
luarocks install html-entities
htmlEntities = require('htmlEntities')
print(htmlEntities.name) -- htmlEntities-for-lua
print(htmlEntities.encode('Tiago Danin :)')) -- Tiago Danin :)
print(htmlEntities.decode('Tiago Danin :)')) -- Tiago Danin :)
Function | Info |
---|---|
htmlEntities | Return table with information about module |
htmlEntities.decode(input) | Decode HTML entities |
string:htmlDecode() | Same as above |
htmlEntities.encode(input) | Encode in HTML entities (in ASCII) NOTE: Emoji is not supported here! |
string:htmlEncode() | Same as above |
htmlEntities.ASCII_HEX(input) | Decode ASCII HEX |
htmlEntities.ASCII_DEC(input) | Decode ASCII DEC |
String | Default | Info |
---|---|---|
error_msg_htmlEntities | false | View log of erros |
debug_htmlEntities | false | Print output |
ASCII_htmlEntities | true | Decode of entities in ASCII |
register_global_module_htmlEntities | false | Register module as global |
global_module_name_htmlEntities | "htmlEntities" | Name in global mode |
To run the test suite:
# Lua
lua tests/cli.lua
# Or
lua tests/travis.lua
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue. List of all contributors.