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

[html] Format does not work if script tag parameters do not have quotes #210303

Open
danzen opened this issue Apr 13, 2024 · 1 comment · May be fixed by #171547
Open

[html] Format does not work if script tag parameters do not have quotes #210303

danzen opened this issue Apr 13, 2024 · 1 comment · May be fixed by #171547
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug html HTML support issues
Milestone

Comments

@danzen
Copy link

danzen commented Apr 13, 2024

Type: Bug

If you use a script tag with a src parameter that does not have quotes then formatting the html page with FORMAT DOCUMENT does not work. It also does not work if you are using script tag with a type=module without putting quotes around the type="module".

This is very unexpected behaviour, should be easy to fix and took over an hour of swearing at VS Code, uninstalling clearing syncs, etc. The same is with Prettier. Finally found it in a Prettier log - but the same thing is happening in the default VS Code formatter.

VS Code version: Code 1.88.1 (e170252, 2024-04-10T17:41:02.734Z)
OS version: Windows_NT x64 10.0.22631
Modes:

System Info
Item Value
CPUs AMD Ryzen 5 5600X 6-Core Processor (12 x 3700)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 15.91GB (4.68GB free)
Process Argv --crash-reporter-id 256c9743-cbab-40e1-ae47-68e562a5c281
Screen Reader no
VM 0%
Extensions (9)
Extension Author (truncated) Version
Bookmarks ale 13.5.0
gitlens eam 14.9.0
swap fau 0.1.0
pro-deployer hem 2.4.1
vscode-favorites how 1.11.0
rainbow-csv mec 3.11.0
LiveServer rit 5.7.9
vscode-fileutils sle 3.10.3
open-in-browser tec 2.0.0
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256859
vscod805cf:30301675
binariesv615:30325510
vsaa593:30376534
py29gd2263:30899288
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythongtdpath:30769146
welcomedialogc:30910334
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
pythontestfixt:30902429
pythonregdiag2:30936856
pyreplss1:30897532
pythonmypyd1:30879173
pythoncet0:30885854
h48ei257:31000450
pythontbext0:30879054
accentitlementsc:30995553
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
bf62j303:30959262
cppperfnew:31000557
d34g3935:30971562
fegfb526:30981948
bg6jg535:30979843
ccp2r6:30993542
dsvsc020:30976470
pythonait:31006305
jchc7451:30973076
gee8j676:31009558
dsvsc021:30996838
g1icg217:30999571
724cj586:31013169

@aeschli
Copy link
Contributor

aeschli commented Apr 15, 2024

I can reproduce with this example:

<html>
    <script type=module>
        const x    = 1;
    </script>
</html>

@aeschli aeschli changed the title Format does not work if script tag parameters do not have quotes [html] Format does not work if script tag parameters do not have quotes Apr 15, 2024
@aeschli aeschli added html HTML support issues bug Issue identified by VS Code Team member as probable bug labels Apr 15, 2024
@aeschli aeschli added this to the Backlog milestone Apr 15, 2024
@johnsoncodehk johnsoncodehk linked a pull request Jun 23, 2024 that will close this issue
35 tasks
johnsoncodehk added a commit to johnsoncodehk/vscode that referenced this issue Jun 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug html HTML support issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants