Merge branch 'master' into gh-3058

pull/3097/head
Rich Harris 6 years ago
commit 5981be8ca5

@ -39,6 +39,9 @@
}],
"@typescript-eslint/no-unused-vars": "off"
},
"globals": {
"globalThis": false
},
"env": {
"es6": true,
"browser": true,

@ -30,7 +30,7 @@
"coverage": "c8 report --reporter=text-lcov > coverage.lcov && c8 report --reporter=html",
"codecov": "codecov",
"precodecov": "npm run coverage",
"build": "rollup -c && npm run tsd",
"build": "rollup -c && npm run lint && npm run tsd",
"prepare": "npm run build",
"dev": "rollup -cw",
"pretest": "npm run build",

@ -234,7 +234,7 @@ export default class Component {
}
helper(name: string) {
const alias = this.alias(name)
const alias = this.alias(name);
this.helpers.set(name, alias);
return alias;
}

@ -344,9 +344,7 @@ export default class ElementWrapper extends Wrapper {
parent.name === 'style'
);
return (raw
? wrapper.node.data
: escape_html(wrapper.node.data))
return (raw ? wrapper.node.data : escape_html(wrapper.node.data))
.replace(/\\/g, '\\\\')
.replace(/`/g, '\\`')
.replace(/\$/g, '\\$');

@ -4,16 +4,14 @@ export default {
<div>&nbsp;hello&nbsp; &nbsp;hello</div>`,
test({ assert, component, target }) {
var divList = target.querySelectorAll('div')
const divList = target.querySelectorAll('div');
assert.equal( divList[0].textContent.charCodeAt( 0 ), 160 );
assert.equal( divList[1].textContent.charCodeAt( 0 ), 160 );
assert.equal( divList[1].textContent.charCodeAt( 6 ), 160 );
assert.equal( divList[1].textContent.charCodeAt( 7 ), 160 );
assert.equal( divList[2].textContent.charCodeAt( 0 ), 160 );
assert.equal( divList[2].textContent.charCodeAt( 6 ), 160 );
assert.equal( divList[2].textContent.charCodeAt( 7 ), 32 );//normal space
assert.equal( divList[2].textContent.charCodeAt( 7 ), 32 ); //normal space
assert.equal( divList[2].textContent.charCodeAt( 8 ), 160 );
}
};
Loading…
Cancel
Save