aidando73 / bitbucket-syntax-highlighting

Add syntax highlighting to your pull requests on Bitbucket
5 stars 1 forks source link

Add basic support for Vue SFC files (as HTML) #68

Closed PhenX closed 1 year ago

PhenX commented 1 year ago

PrismJS does not support this (https://github.com/PrismJS/prism/issues/1665) but highlighting these files as HTML files would already be a lot better.

The extension of theses files is ".vue"

aidando73 commented 1 year ago

Thanks @PhenX for the PR. Appreciate it.

I've given it a test

image

(Though the script and css tags aren't colored - I guess that's Prisms limitation)

PhenX commented 1 year ago

Thank you, you merged it, does it mean the new extension version will be published automatically? Also, I noticed scss files where not highlighted while prismjs supports it, isn't it included in the bundled prismjs? I think it should contain all the features prismjs proposes, what do you think? (only the ones relevant for the extension)

aidando73 commented 1 year ago

I've published 0.0.4 which contains your changes - currently manual haha so I have to publish.

With regards to SCSS files, yes we should - I would welcome an issue or a PR for that one.

PhenX commented 1 year ago

Great! Thank you for the new version. Concerning the Scss files, Prism supports it, but the embedded prism.js file does not contain it (as its header says : https://prismjs.com/download.html#themes=prism-coy&languages=markup+css+clike+javascript+aspnet+bash+c+csharp+go+gradle+hcl+java+json+markdown+markup-templating+objectivec+php+powershell+python+jsx+tsx+ruby+sql+typescript+visual-basic+yaml&plugins=keep-markup) I think the extension should contain all the available languages, plus a few plugins, what do you think?

aidando73 commented 1 year ago

@PhenX I'm currently unsure of the implications of that. I don't want users to have to download too big a css/js file.

But maybe that might not be an issue in this case? Depends on how big the full file is with all the languages. If it's not too big then we could include all of them (except the very esoteric languages that probs no one uses) - otherwise maybe there's a system we can build to allow users to opt out of languages they don't use?

PhenX commented 1 year ago

@REslim30 I think these files are downloaded only once when the user installs the plugin (and when it gets updated), so it seems ok to me. Furthemore, it is zipped (currently the extension files take 90KB and get zipped to 38KB in the xpi).

I did a quick test, with ALL the PrismJS languages and it gives 563 KB of JS and 6KB of CSS. When included in your extension, the zip is 211KB.

It seems really reasonable to me :)

aidando73 commented 1 year ago

That makes sense @PhenX, thanks for looking into that - let's just enable all of them then.