Skip to content

Commit

Permalink
make eslint happy
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkishi committed Jun 13, 2019
1 parent 53864df commit 336cd34
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/compiler/compile/nodes/Element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ export default class Element extends Node {
} else if (
name === 'text' ||
name === 'html'
){
) {
const contenteditable = this.attributes.find(
(attribute: Attribute) => attribute.name === 'contenteditable'
);
Expand All @@ -626,7 +626,7 @@ export default class Element extends Node {
message: `'contenteditable' attribute cannot be dynamic if element uses two-way binding`
});
}
} else if (name !== 'this') {
} else if (name !== 'this') {
component.error(binding, {
code: `invalid-binding`,
message: `'${binding.name}' is not a valid binding`
Expand Down
6 changes: 3 additions & 3 deletions src/compiler/compile/render-ssr/handlers/Element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,12 @@ export default function(node: Element, renderer: Renderer, options: RenderOption
if (name === 'group') {
// TODO server-render group bindings
} else if (contenteditable && (name === 'text' || name === 'html')) {
const snippet = snip(expression)
const snippet = snip(expression);
if (name == 'text') {
node_contents = '${@escape(' + snippet + ')}'
node_contents = '${@escape(' + snippet + ')}';
} else {
// Do not escape HTML content
node_contents = '${' + snippet + '}'
node_contents = '${' + snippet + '}';
}
} else if (binding.name === 'value' && node.name === 'textarea') {
const snippet = snip(expression);
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/internal/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,5 @@ export function once(fn) {
if (ran) return;
ran = true;
fn.call(this, ...args);
}
};
}
6 changes: 3 additions & 3 deletions test/runtime/samples/contenteditable-html/_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ export default {

el.innerHTML = 'every<span>body</span>';

// No updates to data yet
// No updates to data yet
assert.htmlEqual(target.innerHTML, `
<editor>every<span>body</span></editor>
<p>hello <b>world</b></p>
`);

// Handle user input
const event = new window.Event('input');
// Handle user input
const event = new window.Event('input');
await el.dispatchEvent(event);
assert.htmlEqual(target.innerHTML, `
<editor>every<span>body</span></editor>
Expand Down

0 comments on commit 336cd34

Please sign in to comment.