prettier-plugin-blade icon indicating copy to clipboard operation
prettier-plugin-blade copied to clipboard

[Formatting Bug]: punctuation on new line

Open andy-UKC opened this issue 1 year ago • 11 comments

Version

1.14.1

Template before formatting

<p>
hello <b>there</b>.
<p>

Template after formatting

<p>
hello 
<b>there</b>
.
<p>

Expected Behaviour

either

<p>
hello <b>there</b>.
<p>

or

<p>
hello 
<b>there</b>.
<p>

any punctuation after a tag is on a new line, which means a space gets aded on render. Not sure best way it should be handle though

Relevant log output

No response

andy-UKC avatar Dec 11 '24 14:12 andy-UKC

Yes, same here. Is there any workaround?

jtsternberg avatar Mar 04 '25 20:03 jtsternberg

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 May 04 '25 02:05 github-actions[bot]

Bump

jtsternberg avatar May 04 '25 19:05 jtsternberg

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 Jul 04 '25 02:07 github-actions[bot]

Bump

jtsternberg avatar Jul 04 '25 02:07 jtsternberg

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 Sep 04 '25 02:09 github-actions[bot]

Anybody home?

jtsternberg avatar Sep 04 '25 02:09 jtsternberg

Sorry I can not reproduce the behaviour. Can you provide the config? Thanks.

$ cat test.blade.php
<p>
hello <b>there</b>.
<p>

$ ./bin/blade-formatter.cjs test.blade.php
<p>
    hello <b>there</b>.
<p>

shufo avatar Sep 04 '25 04:09 shufo

My .prettierrc:

{
	"printWidth": 120,
	"tabWidth": 4,
	"trailingComma": "all",
	"singleQuote": true,
	"bracketSpacing": true,
	"useTabs": true,
	"plugins": ["prettier-plugin-blade", "prettier-plugin-tailwindcss"],
	"overrides": [
		{
			"files": ["*.blade.php"],
			"options": {
				"parser": "blade"
			}
		}
	]
}

jtsternberg avatar Sep 04 '25 16:09 jtsternberg

oh hmmm it looks like we're using https://www.npmjs.com/package/prettier-plugin-blade in our project, which I somehow mistook for this project!

jtsternberg avatar Sep 04 '25 16:09 jtsternberg

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 04 '25 02:11 github-actions[bot]