Skip to content

VSCode plugin: Syntax highlighting not correctly applied to embedded svelte component in markdown #1094

Open
@wlach

Description

@wlach

Describe the bug
Syntax highlighting not correctly applied to embedded svelte component in markdown when using "Svelte for VSCode"

To Reproduce
Steps to reproduce the behavior:

Put the following inside a markdown document:

```svelte
<script>
  import { onMount } from "svelte";

  export let data = undefined;
  let dom_node;

  onMount(() => {
    Plotly.newPlot(dom_node, data, {barmode: 'stack'});
  });
</script>

<div id="plotDiv" bind:this={dom_node}></div>
```

For example a code snippet that is treated in a way you don't expect.

Expected behavior

Expected similar syntax highlighting to what I see when viewing a svelte file with that content.

Actual behaviour

Get somewhat incorrect / inconsistent formatting (see screenshots)

Screenshots
If applicable, add screenshots to help explain your problem.

View for a svelte component (correct):

image

View for a svelte component embedded in markdown (incorrect):

image

System (please complete the following information):

  • OS: Mac and Windows 10
  • IDE: VSCode
  • Plugin/Package: "Svelte for VSCode"

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions