vscode-blade-formatter icon indicating copy to clipboard operation
vscode-blade-formatter copied to clipboard

[Formatting Bug]: Raw html on js variable with backtick keep adding new indent

Open ExRazor opened this issue 1 year ago • 1 comments

Platform

Windows

Template before formatting

let formHTML = `
	<select id="status_select" class="swal2-select" style="display: flex; margin:10px 0; width:100%">
			<option value="">- Pilih Status -</value>
			<option value="1" ${btn_status===1 ? 'selected' : ''}>Aktif</value>
			<option value="2" ${btn_status===2 ? 'selected' : ''}>Pending</value>
			<option value="0" ${btn_status===0 ? 'selected' : ''}>Nonaktif</value>
	</select>
	<textarea id="status_note" type="text" class="swal2-textarea" style="display: flex; margin:0; width:100%;" placeholder="Tuliskan alasan...">
					${btn_note}
	</textarea>
`;

Template after formatting

let formHTML = `
							<select id="status_select" class="swal2-select" style="display: flex; margin:10px 0; width:100%">
											<option value="">- Pilih Status -</value>
											<option value="1" ${btn_status===1 ? 'selected' : ''}>Aktif</value>
											<option value="2" ${btn_status===2 ? 'selected' : ''}>Pending</value>
											<option value="0" ${btn_status===0 ? 'selected' : ''}>Nonaktif</value>
							</select>
							<textarea id="status_note" type="text" class="swal2-textarea" style="display: flex; margin:0; width:100%;" placeholder="Tuliskan alasan...">
															${btn_note}
							</textarea>
					`;

Expected Behaviour

It keeps indenting the line everytime I format. Especially when I'm turning on "formatOnSave". Recording 2024-08-09 085946

It should be stick like this instead of add more indent... i6iBOtW4ot

Relevant log output

No response

ExRazor avatar Aug 09 '24 01:08 ExRazor

@ExRazor I could not reproduce this behaviour sorry. Can you provide entire template? It might be replated to other part of template.

shufo avatar Sep 08 '24 13:09 shufo

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

github-actions[bot] avatar Nov 08 '24 02:11 github-actions[bot]