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

Can I use this to highlight a Vue template inside a JS file? #28

Closed
David-Else opened this issue Jun 15, 2018 · 1 comment
Closed

Can I use this to highlight a Vue template inside a JS file? #28

David-Else opened this issue Jun 15, 2018 · 1 comment

Comments

@David-Else
Copy link

David-Else commented Jun 15, 2018

EDIT: #38

EDIT: I feel like I just wasted hours of my life! The solution was #14 simply paste into the lit.html.json file:

"begin": "(`)(?=$|[\s\S]<[a-zA-Z][\s\S]>[\s\S]*)",

or even just "(`)"

Please could you just make this default?! I read the whole political problems thread with the guy that came up with this addition, but who cares? This extension is almost perfect with such a tiny mod! THANKS for your work on this!! :)


Hi,

In my standard js file that contains my Vue component I have:

Vue.component('results', {
  props: { result: Object },
  template: `<div>
  <p>Your Expression is <strong>{{result.typeOfExpression}}</strong></p>
  <p>You are <strong>{{result.duality}}</strong></p>
  <p>You are a <strong>{{result.complexity}}</strong> Expression</p>
  <p>Your primary number is <strong>{{result.primaryNumber}}</strong></p>
  <p>Your second number is<strong>{{result.secondNumber}}</strong></p>
  <p>Your third number is<strong>{{result.thirdNumber}}</strong></p>
  <h3>Your 9-Energy Natural Expression is:</h3>
  <h2><strong>{{result.primaryNumber}}-{{result.secondNumber}}-{{result.thirdNumber}}</strong></h2>
  <p><strong>{{result.text}}</strong></p>
</div>`,
});

But the HTML is not being highlighted as it is not in a tagged template literal?

I have been playing about with the syntax for ages now.. please could someone show me how I could make this work?

I can put the HTML string into a variable and have it:

template: variableWithHTMLInString

But how could I make a variable that then has the syntax highlighted?

If I add html in front of the template string the highlighting works, but the program doesn't as it is undefined! Why is this, can't find it in the docs?

Cheers!

@mjbvz
Copy link
Owner

mjbvz commented Nov 12, 2018

Try https://marketplace.visualstudio.com/items?itemName=bierner.comment-tagged-templates as well

The issue isn't about politics, it's that highlighting all strings as html by default with no way to disable the behavior is not good. We likely want something like microsoft/vscode#53885

@mjbvz mjbvz closed this as completed Nov 12, 2018
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

2 participants