-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Setting that would ignore formatting on specific tags, i.e. <svg> ? #719
Comments
Thanks for requesting the feature @yabdab
From my understand, you are talking about like below code with $ cat test.blade.php
<svg height="130" width="500">
<defs>
<linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" style="stop-color:rgb(255,255,0);stop-opacity:1" />
<stop offset="100%" style="stop-color:rgb(255,0,0);stop-opacity:1" />
</linearGradient>
</defs>
<ellipse cx="100" cy="70" rx="85" ry="55" fill="url(#grad1)" />
<text fill="#ffffff" font-size="45" font-family="Verdana" x="50" y="86">SVG</text>
Sorry, your browser does not support inline SVG.
</svg> $ ./bin/blade-formatter test.blade.php --wrap-attributes force-expand-multiline
<svg
height="130"
width="500"
>
<defs>
<linearGradient
id="grad1"
x1="0%"
y1="0%"
x2="100%"
y2="0%"
>
<stop
offset="0%"
style="stop-color:rgb(255,255,0);stop-opacity:1"
/>
<stop
offset="100%"
style="stop-color:rgb(255,0,0);stop-opacity:1"
/>
</linearGradient>
</defs>
<ellipse
cx="100"
cy="70"
rx="85"
ry="55"
fill="url(#grad1)"
/>
<text
fill="#ffffff"
font-size="45"
font-family="Verdana"
x="50"
y="86"
>SVG</text>
Sorry, your browser does not support inline SVG.
</svg>
I agree that it would be a lot of lines. My personal recommendation is if you are concerned about lines of code, split them into Anonymous Components would be a good solution. However, I understand that there are some use cases where it is more convenient to ignore certain tags, so I'll give some thought to what we should do. |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
Formatting things like a
<svg>
tag can take up several lines of code and is not really that necessary.Now this plugin does an excellent job formatting it, but it adds tons of new lines to my code.
This is just a feature request to allow a setting that ignores certain tags if not too much trouble?
I know I can use
{{-- blade-formatter-disable-next-line --}}
, but this would be easier if possible 😉Thanks guys.
The text was updated successfully, but these errors were encountered: