Repository: buxlabs/boxwood (js)

Issue:
<script>'s src not interpolated
In the following snippet the `src` attribute won't be interpolated:

```html
<script type="text/javascript" src="/{ website.javascript }" />
```

while this one works:

```html
<link rel="stylesheet" href="/{ website.stylesheet }">
```

Pull request:
script[src] bugfix
Closes #638 

Patch:
diff --git a/src/tags/script.js b/src/tags/script.js
index 25b3c81..74decb3 100644
--- a/src/tags/script.js
+++ b/src/tags/script.js
@@ -5,7 +5,7 @@ const Bundler = require('../Bundler')
 const { getLiteral } = require('../utilities/ast')
 const { getScopeProperties } = require('../utilities/scope')
 const { findAsset } = require('../utilities/files')
-const { isCurlyTag } = require('../utilities/string')
+const { containsCurlyTag } = require('../utilities/string')
 const { convertAttribute } = require('../utilities/convert')
 let scopeCounter = 0
 
@@ -117,7 +117,7 @@ module.exports = async function ({ tree, keys, attrs, fragment, assets, variable
   } else if (keys.includes('src')) {
     append(getLiteral('<script'))
     fragment.attributes.forEach(attribute => {
-      if (isCurlyTag(attribute.value)) {
+      if (containsCurlyTag(attribute.value)) {
         append(getLiteral(` ${attribute.key}="`))
         append(convertAttribute(attribute.key, attribute.value, variables, filters, translations, languages))
         append(getLiteral('"'))


Test patch:
diff --git a/test/spec/tags/script/basic.spec.js b/test/spec/tags/script/basic.spec.js
new file mode 100644
index 0000000..b8333c5
--- /dev/null
+++ b/test/spec/tags/script/basic.spec.js
@@ -0,0 +1,18 @@
+const test = require('ava')
+const compile = require('../../../helpers/compile')
+const { escape } = require('../../../..')
+
+test('script: src', async assert => {
+  var { template } = await compile(`<script src="{foo}"></script>`)
+  assert.deepEqual(template({ foo: "bar.js" }, escape), '<script src="bar.js"></script>')
+})
+
+test('script: src with shorthand syntax', async assert => {
+  var { template } = await compile(`<script {src}></script>`)
+  assert.deepEqual(template({ src: "foo.js" }, escape), '<script src="foo.js"></script>')
+})
+
+test('script: src with other characters syntax', async assert => {
+  var { template } = await compile(`<script src="/{foo}"></script>`)
+  assert.deepEqual(template({ foo: "bar.js" }, escape), '<script src="/bar.js"></script>')
+})