parent
a0d94cb633
commit
7f8d5869c3
4 changed files with 30 additions and 1 deletions
5
.changeset/rude-cameras-rhyme.md
Normal file
5
.changeset/rude-cameras-rhyme.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'@astrojs/parser': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Bugfix: template literals in JSX tags breaking parser
|
|
@ -84,7 +84,8 @@ function consume_tag(state: ParseState) {
|
||||||
|
|
||||||
switch (char) {
|
switch (char) {
|
||||||
case "'":
|
case "'":
|
||||||
case '"': {
|
case '"':
|
||||||
|
case '`': {
|
||||||
consume_string(state, char);
|
consume_string(state, char);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,4 +64,14 @@ Basics('Build does not include HMR client', async ({ build, readFile }) => {
|
||||||
assert.equal(hmrPortScript.length, 0, 'No script setting the websocket port');
|
assert.equal(hmrPortScript.length, 0, 'No script setting the websocket port');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Basics('Allows forward-slashes in mustache tags (#407)', async ({ runtime }) => {
|
||||||
|
const result = await runtime.load('/forward-slash');
|
||||||
|
const html = result.contents;
|
||||||
|
const $ = doc(html);
|
||||||
|
|
||||||
|
assert.equal($('a[href="/post/one"]').length, 1);
|
||||||
|
assert.equal($('a[href="/post/two"]').length, 1);
|
||||||
|
assert.equal($('a[href="/post/three"]').length, 1);
|
||||||
|
});
|
||||||
|
|
||||||
Basics.run();
|
Basics.run();
|
||||||
|
|
13
packages/astro/test/fixtures/astro-basic/src/pages/forward-slash.astro
vendored
Normal file
13
packages/astro/test/fixtures/astro-basic/src/pages/forward-slash.astro
vendored
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
---
|
||||||
|
const slugs = ['one', 'two', 'three'];
|
||||||
|
---
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
{slugs.map((slug) => (
|
||||||
|
<a href={`/post/${slug}`}>{slug}</a>
|
||||||
|
))}
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in a new issue