File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change
1
+ # LHTMLR
2
+ A fast Lua HTML Parsing/Searching library written in Rust for Lotus Project
3
+
4
+
5
+
6
+
7
+ ### TODO
8
+ - [x] HTML Parsing
9
+ - [x] Generate CSS Selector
10
+ - [x] Element
11
+ - [ ] Text
12
+ - [ ] Comment
13
+ - [ ] Document
14
+
15
+ ### Example
16
+ ``` lua
17
+ local lhtmlr = require (" lhtmlr" )
18
+
19
+ local HTML = [[
20
+ <!DOCTYPE html>
21
+ <html>
22
+ <head>
23
+ <title>My HTML Page</title>
24
+ </head>
25
+ <body>
26
+ <img src="profile.png">
27
+ <h1>Welcome to my HTML page</h1>
28
+ </body>
29
+ </html>
30
+ ]]
31
+
32
+ -- Generate a CSS selector pattern for **custom** Element in the HTML input that has attributes.
33
+ local pattern = lhtmlr .css_selector (" <img src=\" profile.png\" >" ) -- Type: String
34
+ local results = lhtmlr .html_search (HTML , pattern ) -- Type: Table
35
+
36
+ for _ ,value in pairs (results ) do
37
+ print (value )
38
+ end
39
+
40
+ -- <img src="profile.png">
41
+
42
+ ```
43
+
44
+ ### Installation
45
+
46
+ ``` bash
47
+ $ luarocks install lua-lhtmlr --local
48
+ ```
You can’t perform that action at this time.
0 commit comments