1 | var Parser = require("../lib/tlk-htmlparser");
|
2 | var Tree = require("../lib/htmltree");
|
3 | var JSON = require("../lib/tolojson");
|
4 |
|
5 | describe('htmltree', function () {
|
6 | function check(input, output) {
|
7 | var root = Parser.parse(input);
|
8 | var html = Tree.toString(root);
|
9 | if (typeof output === 'undefined') output = input;
|
10 | expect(html).toBe(output);
|
11 | }
|
12 | it('should keep text unchanged', function () {
|
13 | check('Hello world!');
|
14 | check(' Hello world! ');
|
15 | });
|
16 | it('should keep simple tags unchanged', function () {
|
17 | check('Hello <b>world</b>!');
|
18 | check('This is <span class="toto">very <i>fun</i></span>, is not it?');
|
19 | });
|
20 | });
|