Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lit-html templates in MDX highlight oddly #1

Open
bennypowers opened this issue Jan 8, 2020 · 0 comments
Open

lit-html templates in MDX highlight oddly #1

bennypowers opened this issue Jan 8, 2020 · 0 comments

Comments

@bennypowers
Copy link

consider:

Here's a paragraph

```html
<!-- this code block is perfectly highlighted -->
<mwc-textfield outlined
    label="Publishable Key"
    value="dummy-key"
></mwc-textfield>
```

<Story name="A">
  {() => {
    // I'm not highlighted as JS
    function onChange({ target: { value } }) {
      $('output').textContent = value;
    }

    // custom element is weirdly highlighted
    return html`
      <mwc-textfield outlined
          label="Publishable Key"
          value="dummy-key"
          @change="${setPublishableKey}"
      ></mwc-textfield>
      <output></output>
    `
    // highlighting dies here until the next lit-html template starts
  }
</Story>

## This is not highlighted

**neither is this**

<Story name="B" height="60px">
  {() => {
    // highlighting resumes at <section
    // but dies again at </mwc-textfield
    return html`
      <section id="hmm">
        <mwc-textfield></mwc-textfield>
      </section>
    `;
  }}
</Story>

which appears in atom as per the screenshot below:

Screen Shot 2020-01-08 at 14 58 44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant