File tree 3 files changed +178
-118
lines changed
3 files changed +178
-118
lines changed Original file line number Diff line number Diff line change @@ -272,6 +272,22 @@ function newElement(tagName, namespace) {
272
272
} ;
273
273
}
274
274
275
+ var parse5 = require ( 'parse5' ) ;
276
+ var parser = new parse5 . Parser ( ) ;
277
+ var serializer = new parse5 . Serializer ( ) ;
278
+
279
+ function parse ( text ) {
280
+ return parser . parse ( text ) ;
281
+ }
282
+
283
+ function parseFragment ( text ) {
284
+ return parser . parseFragment ( text ) ;
285
+ }
286
+
287
+ function serialize ( ast ) {
288
+ return serializer . serialize ( ast ) ;
289
+ }
290
+
275
291
module . exports = {
276
292
getAttribute : getAttribute ,
277
293
hasAttribute : hasAttribute ,
@@ -298,5 +314,8 @@ module.exports = {
298
314
text : newTextNode ,
299
315
comment : newCommentNode ,
300
316
element : newElement
301
- }
317
+ } ,
318
+ parse : parse ,
319
+ parseFragment : parseFragment ,
320
+ serialize : serialize
302
321
} ;
Original file line number Diff line number Diff line change 13
13
"devDependencies" : {
14
14
"chai" : " ^2.1.1" ,
15
15
"jshint" : " ^2.6.3" ,
16
- "mocha" : " ^2.0.1" ,
17
- "parse5" : " ^1.4.0"
16
+ "mocha" : " ^2.0.1"
18
17
},
19
18
"main" : " dom5.js" ,
20
19
"directories" : {
28
27
"bugs" : {
29
28
"url" : " https://github.com/PolymerLabs/dom5/issues"
30
29
},
31
- "homepage" : " https://github.com/PolymerLabs/dom5"
30
+ "homepage" : " https://github.com/PolymerLabs/dom5" ,
31
+ "dependencies" : {
32
+ "parse5" : " ^1.4.1"
33
+ }
32
34
}
You can’t perform that action at this time.
0 commit comments