Skip to content

Commit

Permalink
minor #2300 [Turbo] delete whitespace for <twig:Turbo:Stream:*> com…
Browse files Browse the repository at this point in the history
…ponents (seb-jean)

This PR was squashed before being merged into the 2.x branch.

Discussion
----------

[Turbo] delete whitespace for `<twig:Turbo:Stream:*>` components

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no

I added whitespace trimming for delete a whitespace for `<twig:Turbo:Stream:*>` components.

Example with below code:

```twig
<twig:Turbo:Stream:Append target="#count-post">
    <div>12</div>
</twig:Turbo:Stream:Append>
```

**Before**

```twig
<turbo-stream action="append" targets="#count-post" >
<template><div>12</div>
</template>
</turbo-stream>
```

**After**

```twig
<turbo-stream action="append" targets="#count-post">
<template><div>12</div>
</template>
</turbo-stream>
```

Commits
-------

7f4d863 [Turbo] delete whitespace for `<twig:Turbo:Stream:*>` components
  • Loading branch information
Kocal committed Oct 25, 2024
2 parents 643f0c9 + 7f4d863 commit 01839ab
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Turbo/templates/components/Stream/After.html.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% props target -%}

<turbo-stream action="after" targets="{{ target }}" {{ attributes }}>
<turbo-stream action="after" targets="{{ target }}" {{- attributes }}>
<template>{% block content %}{% endblock %}</template>
</turbo-stream>
2 changes: 1 addition & 1 deletion src/Turbo/templates/components/Stream/Append.html.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% props target -%}

<turbo-stream action="append" targets="{{ target }}" {{ attributes }}>
<turbo-stream action="append" targets="{{ target }}" {{- attributes }}>
<template>{% block content %}{% endblock %}</template>
</turbo-stream>
2 changes: 1 addition & 1 deletion src/Turbo/templates/components/Stream/Before.html.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% props target -%}

<turbo-stream action="before" targets="{{ target }}" {{ attributes }}>
<turbo-stream action="before" targets="{{ target }}" {{- attributes }}>
<template>{% block content %}{% endblock %}</template>
</turbo-stream>
2 changes: 1 addition & 1 deletion src/Turbo/templates/components/Stream/Prepend.html.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% props target -%}

<turbo-stream action="prepend" targets="{{ target }}" {{ attributes }}>
<turbo-stream action="prepend" targets="{{ target }}" {{- attributes }}>
<template>{% block content %}{% endblock %}</template>
</turbo-stream>
2 changes: 1 addition & 1 deletion src/Turbo/templates/components/Stream/Refresh.html.twig
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{% props requestId = null -%}

<turbo-stream action="refresh"{% if requestId is not null %} request-id="{{ requestId }}"{% endif %} {{ attributes }}></turbo-stream>
<turbo-stream action="refresh"{% if requestId is not null %} request-id="{{ requestId }}"{% endif %} {{- attributes }}></turbo-stream>
2 changes: 1 addition & 1 deletion src/Turbo/templates/components/Stream/Remove.html.twig
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{% props target -%}

<turbo-stream action="remove" targets="{{ target }}" {{ attributes }}></turbo-stream>
<turbo-stream action="remove" targets="{{ target }}" {{- attributes }}></turbo-stream>
2 changes: 1 addition & 1 deletion src/Turbo/templates/components/Stream/Replace.html.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% props target, morph = false -%}

<turbo-stream action="replace" targets="{{ target }}"{% if morph %} method="morph"{% endif %} {{ attributes }}>
<turbo-stream action="replace" targets="{{ target }}"{% if morph %} method="morph"{% endif %} {{- attributes }}>
<template>{% block content %}{% endblock %}</template>
</turbo-stream>
2 changes: 1 addition & 1 deletion src/Turbo/templates/components/Stream/Update.html.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% props target, morph = false -%}

<turbo-stream action="update" targets="{{ target }}"{% if morph %} method="morph"{% endif %} {{ attributes }}>
<turbo-stream action="update" targets="{{ target }}"{% if morph %} method="morph"{% endif %} {{- attributes }}>
<template>{% block content %}{% endblock %}</template>
</turbo-stream>

0 comments on commit 01839ab

Please sign in to comment.