HTML entities decoding/encoding for ComputerCraft.
Based on htmlEntities-for-lua.
- Fast!
- No dependencies!
- Easy to implement!
- Removed
- Merged Improve regex to not match empty html entities
- Added LDoc documentation
- ASCII_htmlEntities is now a parameter for decode and encode
- Replaced error_msg_htmlEntities with assert
- Optimized all functions and made them easier to read
- Added ComputerCraft support and function to convert entities to ASCII only
- Added better tests and changed to busted
- Fixed encode, decode ignoring html entities without ;
soon™
local htmlEntities = require('htmlEntities')
print(htmlEntities.encode('Commandcracker'))
print(htmlEntities.decode('Tiago Danin :)'))
Function | Info |
---|---|
htmlEntities | Return table with information about module |
htmlEntities.decode(input) | Decode HTML entities |
htmlEntities.encode(input) | Encode in HTML entities (in ASCII) NOTE: Emoji is not supported here! |
htmlEntities.ASCII_HEX(input) | Decode ASCII HEX |
htmlEntities.ASCII_DEC(input) | Decode ASCII DEC |
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.