Skip to content

Commit 337d954

Browse files
committed
Release 1.0.2
1 parent cda23fd commit 337d954

File tree

6 files changed

+51
-31
lines changed

6 files changed

+51
-31
lines changed

README.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## #{htmlEntities for lua}
1+
## htmlEntities for lua [![Build Status](https://travis-ci.org/TiagoDanin/htmlEntities-for-lua.svg?branch=master)](https://travis-ci.org/TiagoDanin/htmlEntities-for-lua) [![MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/TiagoDanin/htmlEntities-for-lua/blob/master/LICENSE) [![Luarocks](https://img.shields.io/badge/Luarocks-html--entities-yellow.svg)](http://luarocks.org/modules/tiagodanin/html-entities)
22
**Module for lua, decoding html entities :)**
33

44
Module for decoding of text using entities html
@@ -9,9 +9,8 @@ or encode of text to entities html :V
99
## Requires
1010
Written for Lua5.x
1111

12-
1312
## Setup
14-
Use the terminal(luarocks) `$ `
13+
Use the terminal(luarocks) `$ luarocks install html-entities`
1514

1615
Or Makefile(Debian):
1716

@@ -27,17 +26,11 @@ The same goes for remove `$ make unistall5.x`
2726

2827

2928
## Releases
30-
[htmlEntities-for-lua BETA](https://github.com/TiagoDanin/htmlEntities-for-lua/tree/master)
31-
32-
[htmlEntities-for-lua V0.1.0](https://github.com/TiagoDanin/htmlEntities-for-lua/releases/tag/1.0.1)
33-
34-
[htmlEntities-for-lua V0.4.0](https://github.com/TiagoDanin/htmlEntities-for-lua/releases/tag/0.4.0)
35-
36-
[htmlEntities-for-lua V0.3.1](https://github.com/TiagoDanin/htmlEntities-for-lua/releases/tag/0.3.1)
29+
[BETA](https://github.com/TiagoDanin/htmlEntities-for-lua/tree/master)
3730

38-
[htmlEntities-for-lua V0.2.0](https://github.com/TiagoDanin/htmlEntities-for-lua/releases/tag/0.2)
31+
[Stable](https://github.com/TiagoDanin/htmlEntities-for-lua/releases)
3932

40-
[htmlEntities-for-lua V0.1.0](https://github.com/TiagoDanin/htmlEntities-for-lua/releases/tag/0.1)
33+
[Luarocks](http://luarocks.org/modules/tiagodanin/html-entities)
4134

4235

4336
## DOC
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package = "html-entities"
2+
version = "1.0.2-0"
3+
4+
source = {
5+
url = "https://github.com/TiagoDanin/htmlEntities-for-lua/archive/1.0.2.tar.gz",
6+
dir = "htmlEntities-for-lua-1.0.2"
7+
8+
}
9+
10+
description = {
11+
summary = "Module for lua, decoding html entities :)",
12+
detailed = "Module for decoding of text using entities html or encode of text to entities html :V",
13+
homepage = "https://TiagoDanin.github.io/htmlEntities-for-lua/",
14+
maintainer = "Tiago Danin <TiagoDanin@outlook.com>",
15+
license = "MIT"
16+
}
17+
18+
dependencies = {
19+
"lua >= 5.1"
20+
}
21+
22+
build = {
23+
type = "builtin",
24+
modules = {
25+
["htmlEntities"] = "src/htmlEntities.lua"
26+
}
27+
}

rockspecs/html-entities-git-1.0.1-4.rockspec renamed to rockspecs/html-entities-git-1.rockspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package = "html-entities"
2-
version = "1.0.1-4"
2+
version = "git-1"
33

44
source = {
55
url = "https://github.com/TiagoDanin/htmlEntities-for-lua.git"

src/htmlEntities.lua

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Copyright (c) 2016 Tiago Danin
3131
]==]--
3232

3333
local htmlEntities = {
34-
version = '1.0.1',
34+
version = '1.0.2',
3535
name = 'htmlEntities-for-lua',
3636
author = 'Tiago Danin - 2016',
3737
license = 'MIT',
@@ -2314,20 +2314,6 @@ local htmlEntities_table = {
23142314
['&#8482;'] = ''
23152315
}
23162316

2317-
function htmlEntities.ASCII_DEC (input)
2318-
if not input then
2319-
if error_msg_htmlEntities then error('htmlEntities[ASCII_DEC] >> ERRO: input is value nil') end
2320-
return false
2321-
end
2322-
if string.len(input) == 2 then
2323-
input = tonumber(input, 16)
2324-
local output = htmlEntities.ASCII_HEX(input)
2325-
return output
2326-
else
2327-
return input
2328-
end
2329-
end
2330-
23312317
function htmlEntities.ASCII_HEX (input)
23322318
if not input then
23332319
if error_msg_htmlEntities then error('htmlEntities[ASCII_HEX] >> ERRO: input is value nil') end
@@ -2348,6 +2334,20 @@ function htmlEntities.ASCII_HEX (input)
23482334
end
23492335
end
23502336

2337+
function htmlEntities.ASCII_DEC (input)
2338+
if not input then
2339+
if error_msg_htmlEntities then error('htmlEntities[ASCII_DEC] >> ERRO: input is value nil') end
2340+
return false
2341+
end
2342+
if string.len(input) == 2 then
2343+
input = tonumber(input, 16)
2344+
local output = htmlEntities.ASCII_HEX(input)
2345+
return output
2346+
else
2347+
return input
2348+
end
2349+
end
2350+
23512351
function htmlEntities.decode (input)
23522352
if not input then
23532353
if error_msg_htmlEntities then error('htmlEntities[decode] >> ERRO: input is value nil') end

tests/test.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
htmlEntities = require('htmlEntities')
1+
htmlEntities = require('htmlEntities')--require('src/htmlEntities')
22

33
print('\n\nInit test htmlEntities')
44
local text = [[&amp;&#88;&#65;&#77;&#80;&#76;&#69; text
@@ -60,7 +60,7 @@ function type()
6060
dec = string.format('%02X', hex)
6161
local x_1 = htmlEntities.ASCII_HEX(hex)
6262
table.insert(char, x_1)
63-
local x_2 =utf8 htmlEntities.ASCII_DEC(dec)
63+
local x_2 = htmlEntities.ASCII_DEC(dec)
6464
table.insert(char, x_2)
6565
end
6666
local time_1 = io.popen('date +%S.%N'):read('*all')

tests/travis.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ for i = 33, 255 do
1818
dec = string.format('%02X', hex)
1919
local x_1 = htmlEntities.ASCII_HEX(hex)
2020
table.insert(char, x_1)
21-
local x_2 =utf8 htmlEntities.ASCII_DEC(dec)
21+
local x_2 = htmlEntities.ASCII_DEC(dec)
2222
table.insert(char, x_2)
2323
end
2424
local encode = {'&micro;', '&yen;', '&uuml;', '&lrm;', '&#8482;', '&lceil;', '&#45;'}

0 commit comments

Comments
 (0)