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

Feature request: syntax highlighting for vue language code blocks in markdown #1024

Closed
3 tasks done
h0adp0re opened this issue Dec 11, 2018 · 4 comments · Fixed by #1485
Closed
3 tasks done

Feature request: syntax highlighting for vue language code blocks in markdown #1024

h0adp0re opened this issue Dec 11, 2018 · 4 comments · Fixed by #1485
Labels

Comments

@h0adp0re
Copy link

h0adp0re commented Dec 11, 2018

  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ

Info

  • Platform: macOS
  • Vetur version: 0.14.3
  • VS Code version: 1.29.1

Problem

When writing documentation for vue SFCs, it's often needed to provide examples. It'd be great if those examples would be as readable as the real SFCs.

Reproducible Case

Create a code block in markdown. Set the block's language to vue.

    ```vue
      ...

    ```
<template>
  <div class="custom-component">
    <slot />
  </div>
</template>

<script>
  export default {
    name: 'custom-component',
  };
</script>

<style lang="scss">
  .custom-component {
    padding: 1rem;
  }
</style>

GitHub highlights it, why shouldn't Vetur?

@octref
Copy link
Member

octref commented Dec 12, 2018

@octref
Copy link
Member

octref commented Dec 12, 2018

In short, this needs:

  1. Markdown uses vue grammar injection (doable)
  2. Markdown uses the js, html, css grammar injection inside the vue grammar injection (doesn't work in VS Code now)

@mjbvz
Copy link
Contributor

mjbvz commented Dec 12, 2018

New fenced code block highlighting can be contributed by extensions, see: https://github.com/mjbvz/vscode-fenced-code-block-grammar-injection-example

@h0adp0re
Copy link
Author

Any progress or ideas on this?

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

Successfully merging a pull request may close this issue.

3 participants