Skip to content

Commit 737c5f2

Browse files
committed
Merge branch 'milestone-1.4.3' of github.com:posthtml/posthtml-expressions into milestone-1.4.3
2 parents 65bda50 + 7f5a2cf commit 737c5f2

File tree

5 files changed

+29
-3
lines changed

5 files changed

+29
-3
lines changed

lib/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,6 @@ function walk (opts, nodes) {
172172

173173
// don't parse ignoredTag
174174
if (node.tag === ignored) {
175-
// node.tag = false
176-
177175
m.push(node)
178176

179177
return m

test/expect/raw_in_switch.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Hello from Earth, {{ username }}
2+
3+
4+
5+
Hello from Moscow, {{ username }}

test/fixtures/raw_in_switch.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<switch expression="country">
2+
<case n="'russia'">
3+
<p>Hello, from Russia!</p>
4+
</case>
5+
<default>
6+
<raw>Hello from Earth, {{ username }}</raw>
7+
</default>
8+
</switch>
9+
10+
<switch expression="city">
11+
<case n="'moscow'">
12+
<raw>Hello from Moscow, {{ username }}</raw>
13+
</case>
14+
<default>
15+
<p>Hello, from Earth!</p>
16+
</default>
17+
</switch>

test/test-core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ test('Raw output', (t) => {
7878
return process(t, 'raw', { locals: { foo: 'bar' } })
7979
})
8080

81-
test.only('Raw output - inside condition', (t) => {
81+
test('Raw output - inside condition', (t) => {
8282
return process(t, 'raw_in_condition', { locals: { foo: 'bar' } })
8383
})
8484

test/test-switch.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,9 @@ test('Switch - bad flow', (t) => {
9090
t.is(err.message, 'the "switch" tag can contain only "case" tags and one "default" tag')
9191
})
9292
})
93+
94+
test('Switch - raw tag', (t) => {
95+
return Promise.all([
96+
process(t, 'raw_in_switch', { locals: { country: 'germany', city: 'moscow' } })
97+
])
98+
})

0 commit comments

Comments
 (0)