Skip to content

Commit

Permalink
closes #171
Browse files Browse the repository at this point in the history
  • Loading branch information
kj committed Nov 18, 2023
1 parent a308542 commit 104d1b2
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions app/docs/md/conventions/browser.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Write a pure function for returning the HTML markup for the `my-message.mjs` cus

```javascript
export default function MyMessage({ html, state }) {
const { attrs=[] } = state
const { attrs={} } = state
const { message='' } = attrs

return html`<h1>${ message }</h1>`
Expand Down Expand Up @@ -117,12 +117,7 @@ class MyMessageElement extends HTMLElement {
}

html(strings, ...values) {
const collect = []
for (let i = 0; i < strings.length - 1; i++) {
collect.push(strings[i], values[i])
}
collect.push(strings[strings.length - 1])
return collect.join('')
return String.raw({ raw: strings }, ...values)
}

static get observedAttributes() {
Expand Down

0 comments on commit 104d1b2

Please sign in to comment.