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

cannot format javascript when razor in script tag #10379

Open
vsfeedback opened this issue May 17, 2024 · 1 comment
Open

cannot format javascript when razor in script tag #10379

vsfeedback opened this issue May 17, 2024 · 1 comment
Labels
author: migration bot 🤖 The issue was created by a issue mover bot. The author may not be the actual author

Comments

@vsfeedback
Copy link

This issue has been moved from a ticket on Developer Community.


for example:<script type="text/javascript"> function foo() { return false; //note there have too many whitespace } @if (true) { } //if remoe this code, ctrl+K,D work fine</script>


Original Comments

Armando Aguirre Sepulveda [MSFT] on 29/09/2017, 04:32 AM:

(private comment, text removed)

Mohamad Yahia on 26/09/2019, 03:22 PM:

(private comment, text removed)

ahdung-ai on 26/09/2019, 04:43 PM:

(private comment, text removed)

pauldbentley on 13/08/2022, 01:49 AM:

(private comment, text removed)


Original Solutions

Mohamad Yahia solved on 26/09/2019, 04:55 PM, 1 votes:

I found a simple work around for when I first open a file and it’s not formatted

  • Replace all @ with @@

  • Format Document

  • Replace all @@ with @

That works but it’s a pain and normal formatting should just work.

ahdung-ai on 26/09/2019, 05:01 PM:

(private comment, text removed)

Mohamad Yahia solved on 26/09/2019, 03:23 PM, 0 votes:

*DELETED COMMENT*

@dotnet-policy-service dotnet-policy-service bot added untriaged author: migration bot 🤖 The issue was created by a issue mover bot. The author may not be the actual author labels May 17, 2024
@davidwengier
Copy link
Contributor

Couldn't find an issue for this, and when I tried to repro, I couldn't get JavaScript formatting to work at all, whether there was an @if in there or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author: migration bot 🤖 The issue was created by a issue mover bot. The author may not be the actual author
Projects
None yet
Development

No branches or pull requests

3 participants