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

Support Vue SFC syntax #1665

Open
privatenumber opened this issue Dec 18, 2018 · 10 comments
Open

Support Vue SFC syntax #1665

privatenumber opened this issue Dec 18, 2018 · 10 comments

Comments

@privatenumber
Copy link

Currently, it doesn't seem like Prism (or any other syntax highlighting library) supports the Vue Single File Components syntax.

I'd like to request support for this syntax.

@jwkicklighter
Copy link

Would love support for this

@CesarApodaca
Copy link

I really love this library and would be great to have Vue SFC support

@mAAdhaTTah
Copy link
Member

I actually think this may be supportable without a custom syntax. If you load JavaScript & CSS then markup, you should be able to render Vue SFCs in the markup language and have everything highlighted properly.

@RunDevelopment
Copy link
Member

@mAAdhaTTah That won't work. Ignoring the templating syntax, there still is the issue that the style and script tags do not have to contain JS and CSS (an example with Stylus). Markup might be a good starting point but there is no avoiding a new language.

LeSuisse added a commit to Enalean/tuleap that referenced this issue Nov 27, 2019
…it web browsing view

PrismJS, the library Tuleap uses to do the syntax highlighting,
does not a have a support for the Vue SFC syntax [0] but marking
Vue SFC file as "markup" seems to lead to a better highlighting
at least in common cases.

[0] PrismJS/prism#1665

Change-Id: I88543b9fd6c41bf660c4c94567a9e51690b49f67
@saulhardman
Copy link

I actually think this may be supportable without a custom syntax. If you load JavaScript & CSS then markup, you should be able to render Vue SFCs in the markup language and have everything highlighted properly.

html also works nicely in my experience – thanks for the suggestion 👍

kristianfreeman added a commit to cloudflare/cloudflare-docs-engine that referenced this issue Oct 29, 2020
Prism doesn't have Vue SFC syntax highlighting (PrismJS/prism#1665) so we should alias it to the `html` syntax for the near future
adamschwartz pushed a commit to cloudflare/cloudflare-docs-engine that referenced this issue Oct 29, 2020
Prism doesn't have Vue SFC syntax highlighting (PrismJS/prism#1665) so we should alias it to the `html` syntax for the near future
@littlee
Copy link

littlee commented Nov 5, 2020

Which version will support this?
v1.22.0 is still not cool enough when parsing v-bind attributes

image

@hatboysam
Copy link

Driving by with a +1 for this issue. I'm very happy with Prism on https://codeapprove.com but this is one of the main sticking points.

@BrettGregson
Copy link

+1 for Vue syntax highlighting

@linlinyang
Copy link

linlinyang commented Jan 11, 2024

typescript in vue3 work failed such as:

<template>{{ num }}</template>

<script lang="ts" setup>
const num: number = 123;
</script>

num: number syntax cannot highlight

@LeaVerou
Copy link
Member

Which version will support this? v1.22.0 is still not cool enough when parsing v-bind attributes

Most likely v2, since v1 is feature frozen.

msfstef added a commit to electric-sql/electric that referenced this issue Feb 28, 2024
The [Vue docs](https://electric-sql.com/docs/integrations/frontend/vue)
were using the `vue` syntax highlighting language, which is [not
supported by Prism](https://prismjs.com/#supported-languages).

There's open issues to support SFC syntax (see
PrismJS/prism#1665) but until then using
`html` syntax highlighting seems to do a relatively decent job as a
workaround.


before and after pics:
<img width="500" alt="Screenshot 2024-02-28 at 17 29 12"
src="https://github.com/electric-sql/electric/assets/12274098/be726ef6-dd83-493c-b459-7b4081094f2e">
<img width="500" alt="Screenshot 2024-02-28 at 17 29 00"
src="https://github.com/electric-sql/electric/assets/12274098/dec91b38-cef8-4ea3-9af5-ca362f394905">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests