Skip to content

Add Javascript syntax highlighting for Alpine JS attributes by adding a comment

License

Notifications You must be signed in to change notification settings

danieledep/alpinejs-comment-hl

Repository files navigation

alpinejs-comment-hl

Add Javascript syntax highlighting for Alpine JS x- attributes by adding a comment

  x-data="{
    // javascript
    open: false
  }"

It also adds normal greyed-out comments inside the x- attributes that don't trigger the Javascript syntax highlighting.

  x-data="{
    // just a grey comment
    open: false
  }"

Supported comments

// js
// javascript
// MARK: js
// MARK: javascript
// #region js
// #region javascript
/* js */
/* javascript */
/* MARK: js */
/* MARK: javascript */
/* #region js */
/* #region javascript */

⚠️ Section headers don't show in the minimap
Vscode doesn't support yet section headers triggered in embedded languages.

Supported Files

  • Html
  • Jinja
  • Liquid
  • Nunjucks
  • Php
  • Twig

Credit

This is a fork of Sperovita/alpinejs-syntax-highlight

Based off of textmate syntaxes from Vetur

About

Add Javascript syntax highlighting for Alpine JS attributes by adding a comment

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published