Skip to content

Commit bb22948

Browse files
committed
style: after lint
1 parent 53a7af4 commit bb22948

File tree

2 files changed

+129
-129
lines changed

2 files changed

+129
-129
lines changed

test/render.test.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,22 @@ describe('PostHTML Render', function () {
2020
})
2121

2222
it('{Array}', function () {
23-
expect(render([ 'Hello world!' ])).to.eql('Hello world!')
23+
expect(render(['Hello world!'])).to.eql('Hello world!')
2424
})
2525

2626
describe('Tags', function () {
2727
it('Empty', function () {
28-
expect(render({ content: [ 'Test' ] })).to.eql('<div>Test</div>')
28+
expect(render({ content: ['Test'] })).to.eql('<div>Test</div>')
2929
})
3030

3131
it('{Boolean} (false) -> {String}', function () {
3232
expect(render({ tag: false, content: 'Test' })).to.eql('Test')
33-
expect(render({ tag: false, content: [ 'Test' ] })).to.eql('Test')
33+
expect(render({ tag: false, content: ['Test'] })).to.eql('Test')
3434
})
3535

3636
it('{Boolean} (false) -> {Number}', function () {
3737
expect(render({ tag: false, content: 555 })).to.eql('555')
38-
expect(render({ tag: false, content: [ 555 ] })).to.eql('555')
38+
expect(render({ tag: false, content: [555] })).to.eql('555')
3939
})
4040
})
4141

@@ -125,19 +125,19 @@ describe('PostHTML Render', function () {
125125
})
126126

127127
it('{Array<String>}', function () {
128-
var fixture = { content: [ 'Hello world!' ] }
128+
var fixture = { content: ['Hello world!'] }
129129
var expected = '<div>Hello world!</div>'
130130

131131
expect(render(fixture)).to.eql(expected)
132132
})
133133

134134
it('{Number}', function () {
135135
expect(render({ content: 555 })).to.eql('<div>555</div>')
136-
expect(render({ content: [ 555 ] })).to.eql('<div>555</div>')
136+
expect(render({ content: [555] })).to.eql('<div>555</div>')
137137
})
138138

139139
it('{Array<Number>}', function () {
140-
expect(render({ content: [ 555 ] })).to.eql('<div>555</div>')
140+
expect(render({ content: [555] })).to.eql('<div>555</div>')
141141
})
142142

143143
it('{Array}', function () {
@@ -161,7 +161,7 @@ describe('PostHTML Render', function () {
161161
{
162162
content: [
163163
{
164-
content: [ 'Test', {} ]
164+
content: ['Test', {}]
165165
}
166166
]
167167
}
@@ -225,7 +225,7 @@ describe('PostHTML Render', function () {
225225
})
226226

227227
it('Custom {String}', function () {
228-
var options = { singleTags: [ 'rect' ] }
228+
var options = { singleTags: ['rect'] }
229229

230230
var fixture = { tag: 'rect' }
231231
var expected = '<rect>'
@@ -234,7 +234,7 @@ describe('PostHTML Render', function () {
234234
})
235235

236236
it('Custom {RegExp}', function () {
237-
var options = { singleTags: [ /^%.*%$/ ] }
237+
var options = { singleTags: [/^%.*%$/] }
238238

239239
var fixture = { tag: '%=title%' }
240240
var expected = '<%=title%>'
@@ -243,7 +243,7 @@ describe('PostHTML Render', function () {
243243
})
244244

245245
it('Attrs', function () {
246-
var options = { singleTags: [ 'rect' ] }
246+
var options = { singleTags: ['rect'] }
247247

248248
var fixture = { tag: 'rect', attrs: { id: 'id' } }
249249
var expected = '<rect id="id">'
@@ -312,7 +312,7 @@ describe('PostHTML Render', function () {
312312
it('Required Space', function () {
313313
var options = { quoteAllAttributes: false }
314314

315-
var fixture = { 'tag': 'p', 'attrs': { 'id': 'asd adsasd' } }
315+
var fixture = { tag: 'p', attrs: { id: 'asd adsasd' } }
316316
var expected = '<p id="asd adsasd"></p>'
317317

318318
expect(render(fixture, options)).to.eql(expected)

test/templates/parser.js

Lines changed: 117 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -1,182 +1,182 @@
11
/* jshint maxlen: false */
22
module.exports = ['<!DOCTYPE html>', '\n', {
3-
'tag': 'html',
4-
'attrs': {
5-
'xmlns': 'http://www.w3.org/1999/xhtml',
6-
'lang': 'en-US'
3+
tag: 'html',
4+
attrs: {
5+
xmlns: 'http://www.w3.org/1999/xhtml',
6+
lang: 'en-US'
77
},
8-
'content': ['\n', {
9-
'tag': 'head',
10-
'content': ['\n ', {
11-
'tag': 'meta',
12-
'attrs': {
13-
'charset': 'utf-8'
8+
content: ['\n', {
9+
tag: 'head',
10+
content: ['\n ', {
11+
tag: 'meta',
12+
attrs: {
13+
charset: 'utf-8'
1414
}
1515
}, '\n ', {
16-
'tag': 'title',
17-
'content': ['Html']
16+
tag: 'title',
17+
content: ['Html']
1818
}, '\n ', {
19-
'tag': 'meta',
20-
'attrs': {
19+
tag: 'meta',
20+
attrs: {
2121
'http-equiv': 'X-UA-Compatible',
22-
'content': 'IE=EmulateIE7, IE=9'
22+
content: 'IE=EmulateIE7, IE=9'
2323
}
2424
}, '\n ', {
25-
'tag': 'meta',
26-
'attrs': {
27-
'name': 'viewport',
28-
'content': 'width=device-width, initial-scale=1'
25+
tag: 'meta',
26+
attrs: {
27+
name: 'viewport',
28+
content: 'width=device-width, initial-scale=1'
2929
}
3030
}, '\n ', {
31-
'tag': 'meta',
32-
'attrs': {
33-
'name': 'description',
34-
'content': 'Description'
31+
tag: 'meta',
32+
attrs: {
33+
name: 'description',
34+
content: 'Description'
3535
}
3636
}, '\n\n ', {
37-
'tag': 'meta',
38-
'attrs': {
39-
'property': 'og:url',
40-
'content': 'http://github.com/posthtml'
37+
tag: 'meta',
38+
attrs: {
39+
property: 'og:url',
40+
content: 'http://github.com/posthtml'
4141
}
4242
}, '\n ', {
43-
'tag': 'meta',
44-
'attrs': {
45-
'property': 'og:type',
46-
'content': 'website'
43+
tag: 'meta',
44+
attrs: {
45+
property: 'og:type',
46+
content: 'website'
4747
}
4848
}, '\n ', {
49-
'tag': 'meta',
50-
'attrs': {
51-
'property': 'og:site_name',
52-
'content': 'PostHTML'
49+
tag: 'meta',
50+
attrs: {
51+
property: 'og:site_name',
52+
content: 'PostHTML'
5353
}
5454
}, '\n\n ', {
55-
'tag': 'link',
56-
'attrs': {
57-
'rel': 'stylesheet',
58-
'type': 'text/css',
59-
'href': 'path/to/file.css'
55+
tag: 'link',
56+
attrs: {
57+
rel: 'stylesheet',
58+
type: 'text/css',
59+
href: 'path/to/file.css'
6060
}
6161
}, '\n ', {
62-
'tag': 'script',
63-
'attrs': {
64-
'src': 'path/to/file.js',
65-
'type': 'text/javascript',
66-
'charset': 'utf-8'
62+
tag: 'script',
63+
attrs: {
64+
src: 'path/to/file.js',
65+
type: 'text/javascript',
66+
charset: 'utf-8'
6767
}
6868
}, '\n\n ', {
69-
'tag': 'script',
70-
'content': ["\n console.log('PostHTML!');\n "]
69+
tag: 'script',
70+
content: ["\n console.log('PostHTML!');\n "]
7171
}, '\n']
7272
}, '\n', {
73-
'tag': 'body',
74-
'attrs': {
75-
'onload': "try{if(!google.j.b){document.f&&document.f.q.focus();document.gbqf&&document.gbqf.q.focus();}}catch(e){}if(document.images)new Image().src='/images/nav_logo231.png'"
73+
tag: 'body',
74+
attrs: {
75+
onload: "try{if(!google.j.b){document.f&&document.f.q.focus();document.gbqf&&document.gbqf.q.focus();}}catch(e){}if(document.images)new Image().src='/images/nav_logo231.png'"
7676
},
77-
'content': ['\n\n ', {
78-
'tag': 'h1',
79-
'content': ['Title']
77+
content: ['\n\n ', {
78+
tag: 'h1',
79+
content: ['Title']
8080
}, '\n ', {
81-
'tag': 'p',
82-
'content': ['Lorem ipsum dolor sit amet...']
81+
tag: 'p',
82+
content: ['Lorem ipsum dolor sit amet...']
8383
}, '\n\n ', {
84-
'tag': 'section',
85-
'attrs': {
86-
'class': 'foo',
87-
'style': 'color: red;'
84+
tag: 'section',
85+
attrs: {
86+
class: 'foo',
87+
style: 'color: red;'
8888
},
89-
'content': ['\n ', {
90-
'tag': 'header',
91-
'attrs': {
92-
'class': 'foo bar',
93-
'style': 'color: blue; border: 1px solid',
94-
'id': 'id'
89+
content: ['\n ', {
90+
tag: 'header',
91+
attrs: {
92+
class: 'foo bar',
93+
style: 'color: blue; border: 1px solid',
94+
id: 'id'
9595
},
96-
'content': ['\n ', {
97-
'tag': 'div',
98-
'attrs': {
99-
'class': 'foo bar baz',
100-
'id': 'idd',
96+
content: ['\n ', {
97+
tag: 'div',
98+
attrs: {
99+
class: 'foo bar baz',
100+
id: 'idd',
101101
'data-url': 'url/to/'
102102
},
103-
'content': ['\n ', {
104-
'tag': 'span',
105-
'attrs': {
106-
'id': 'idd',
103+
content: ['\n ', {
104+
tag: 'span',
105+
attrs: {
106+
id: 'idd',
107107
'data-data': "{ foo: 'bar' }"
108108
},
109-
'content': ['\n ', {
110-
'tag': 'a',
111-
'attrs': {
112-
'href': '#'
109+
content: ['\n ', {
110+
tag: 'a',
111+
attrs: {
112+
href: '#'
113113
},
114-
'content': ['\n ', {
115-
'tag': 'img',
116-
'attrs': {
117-
'src': 'path/to/img'
114+
content: ['\n ', {
115+
tag: 'img',
116+
attrs: {
117+
src: 'path/to/img'
118118
}
119119
}, '\n Link\n ']
120120
}, '\n ']
121121
}, '\n ']
122122
}, '\n ']
123123
}, '\n ']
124124
}, '\n\n ', {
125-
'content': {
126-
'tag': 'hr'
125+
content: {
126+
tag: 'hr'
127127
}
128128
}, '\n\n ', {
129-
'tag': 'script',
130-
'attrs': {
131-
'type': 'text/javascript'
129+
tag: 'script',
130+
attrs: {
131+
type: 'text/javascript'
132132
},
133-
'content': [
133+
content: [
134134
'\n (function(){function k(a){++b;a=a||window.event;google.iTick(a.target||a.srcElement)}if(google.timers&&google.timers.load.t){var c,b,f;google.c.c.a&&(google.startTick("aft"),google.afte=!1);var g=document.getElementsByTagName("img");c=g.length;for(var d=b=0,a;d',
135135
'<c;++d)if(a=g[d],google.c.c.i&&"none"==a.style.display)++b;else{var h="string"!=typeof a.src||!a.src,e=h||a.complete;google.c.c.d?a.getAttribute("data-deferred")&&(e=!1,a.removeAttribute("data-deferred")):google.c.c.m&&h&&a.getAttribute("data-bsrc")&&\n (e=!1);e?++b:google.rll(a,!0,k)}f=c-b;google.rll(window,!1,function(){google.tick("load","ol");google.c.e("load","imc",String(b));google.c.e("load","imn",String(c));google.c.e("load","imp",String(f));google.unblockCSI("load","ol")});google.tick("load",["prt","iml"])}})();\n '
136136
]
137137
}, '\n\n ', {
138-
'tag': 'script',
139-
'attrs': {
140-
'src': 'path/to/file2.js',
141-
'type': 'text/javascript',
142-
'charset': 'utf-8'
138+
tag: 'script',
139+
attrs: {
140+
src: 'path/to/file2.js',
141+
type: 'text/javascript',
142+
charset: 'utf-8'
143143
}
144144
}, '\n']
145145
}, '\n']
146146
}, '\n', {
147-
'tag': false,
148-
'content': [NaN]
147+
tag: false,
148+
content: [NaN]
149149
}, {
150-
'tag': false,
151-
'content': [[]]
150+
tag: false,
151+
content: [[]]
152152
}, {
153-
'tag': false,
154-
'content': ['']
153+
tag: false,
154+
content: ['']
155155
}, {
156-
'tag': false,
157-
'content': [null]
156+
tag: false,
157+
content: [null]
158158
}, {
159-
'tag': false,
160-
'content': [false]
159+
tag: false,
160+
content: [false]
161161
}, {
162-
'tag': false,
163-
'content': [undefined]
162+
tag: false,
163+
content: [undefined]
164164
}, {
165-
'tag': false,
166-
'content': NaN
165+
tag: false,
166+
content: NaN
167167
}, {
168-
'tag': false,
169-
'content': []
168+
tag: false,
169+
content: []
170170
}, {
171-
'tag': false,
172-
'content': ''
171+
tag: false,
172+
content: ''
173173
}, {
174-
'tag': false,
175-
'content': null
174+
tag: false,
175+
content: null
176176
}, {
177-
'tag': false,
178-
'content': false
177+
tag: false,
178+
content: false
179179
}, {
180-
'tag': false,
181-
'content': undefined
180+
tag: false,
181+
content: undefined
182182
}, NaN, [], '', null, false, undefined]

0 commit comments

Comments
 (0)