als-document 0.6.11 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/document.js +21 -10
- package/document.mjs +804 -0
- package/package.json +3 -6
- package/readme.md +10 -3
- package/test/{html1.js → data/html1.js} +1 -2
- package/test/{html2.js → data/html2.js} +1 -1
- package/test/front-test/html.html +5650 -0
- package/test/front-test/html.js +3218 -0
- package/test/front-test/test.html +18 -0
- package/test/front-test/test.js +129 -0
- package/test/test.html +17 -0
- package/test/test.js +15 -19
- package/test/tests/document-test.js +402 -0
- package/test/tests/parser-test.js +99 -0
- package/test/tests/query-test.js +71 -0
- package/test/tests/selector-test.js +169 -0
- package/test/utils/__dirname.js +6 -0
- package/test/utils/als-simple-test/test.mjs +153 -0
- package/test/utils/iframe.js +4 -0
- package/document/document.js +0 -192
- package/document/test.js +0 -678
- package/document.min.js +0 -1
- package/index.js +0 -6
- package/parser/parser.js +0 -340
- package/parser/test.js +0 -233
- package/query/query.js +0 -147
- package/query/readme.md +0 -134
- package/query/test.js +0 -143
- package/selector/selector.js +0 -126
- package/selector/test.js +0 -410
package/package.json
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "als-document",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Build virtual dom from string and manage it, similar you do it on browser",
|
|
5
|
-
"main": "
|
|
6
|
-
"
|
|
7
|
-
"test": "node test/test.js"
|
|
8
|
-
},
|
|
9
|
-
"keywords": ["htmlparser","css query","cheerio","virtual dom"],
|
|
5
|
+
"main": "document.js",
|
|
6
|
+
"keywords": ["html parser","css query","cheerio","virtual dom"],
|
|
10
7
|
"author": "Alex Sorkin",
|
|
11
8
|
"license": "ISC",
|
|
12
9
|
"dependencies": {}
|
package/readme.md
CHANGED
|
@@ -35,6 +35,12 @@ Als-document is a library which includes 4 instruments:
|
|
|
35
35
|
- [Attribs and check function](#attribs-and-check-function)
|
|
36
36
|
|
|
37
37
|
## Update
|
|
38
|
+
**New in 0.7.0**
|
|
39
|
+
* innerText - includes child elements
|
|
40
|
+
* inner - only child tet elements
|
|
41
|
+
* Proxy for style setter and delete fixed
|
|
42
|
+
* parsing attribute value inside '' in addition to ""
|
|
43
|
+
|
|
38
44
|
**new in 0.6.1**
|
|
39
45
|
* attribute parsing bug with '=' inside value, fixed
|
|
40
46
|
* tag parsing improved
|
|
@@ -45,10 +51,10 @@ You can use als-document on node.js and in browser.
|
|
|
45
51
|
|
|
46
52
|
For using in browser, just include:
|
|
47
53
|
``node_modules/als-document/document.js``
|
|
48
|
-
or ``node_modules/als-document/document.
|
|
54
|
+
or ``node_modules/als-document/document.mjs`` for script type=module.
|
|
49
55
|
|
|
50
56
|
```html
|
|
51
|
-
<script src="node_modules/als-document/document.
|
|
57
|
+
<script src="node_modules/als-document/document.js"></script>
|
|
52
58
|
```
|
|
53
59
|
|
|
54
60
|
For using on backend, require from ``als-document``.
|
|
@@ -101,7 +107,8 @@ Each element (except root and text elements, which has no all) has:
|
|
|
101
107
|
* ``n`` - separate elements in innerHTML by n. default n = '\n'
|
|
102
108
|
* ``style`` - Proxy array of styles with camelCase property name
|
|
103
109
|
* getters
|
|
104
|
-
* ``
|
|
110
|
+
* ``inner`` - concats joined children text elements | ''
|
|
111
|
+
* ``innerText`` - concats joined children text elements and child elements text | ''
|
|
105
112
|
* ``innerHTML`` - return innerHTML for element
|
|
106
113
|
* ``outerHTML`` - return outerHTML for element
|
|
107
114
|
* ``ancestors`` - return array of ancestors
|
|
@@ -1123,4 +1123,4 @@ let html2 = /*html*/`
|
|
|
1123
1123
|
<iframe name="__tcfapiLocator" style="display: none;"></iframe><iframe name="__uspapiLocator" style="display: none;"></iframe><iframe src="https://www.google.com/recaptcha/api2/aframe" width="0" height="0" style="display: none;"></iframe></body></html>
|
|
1124
1124
|
`
|
|
1125
1125
|
|
|
1126
|
-
|
|
1126
|
+
export default html2
|