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

{{ noparse }} content disappear in nested partials with {{ slot }} #11485

Open
sosias opened this issue Feb 21, 2025 · 0 comments
Open

{{ noparse }} content disappear in nested partials with {{ slot }} #11485

sosias opened this issue Feb 21, 2025 · 0 comments
Labels

Comments

@sosias
Copy link

sosias commented Feb 21, 2025

Bug description

In antlers when using {{ noparse }} inside nested partials that use a {{ slot }}, only the first two {{ noparse }} are rendered, the third and the further ones disappear.

The problem arises when the partials are structured in this way:

partial_a
  partial_b
    NO_PARSE
  /partial_b
/partial_a

How to reproduce

In a new statamic project add these 3 antlers files:

resources/views/_partial_a.antlers.html

{{ slot }}

resources/views/_partial_b.antlers.html

{{ slot }}

resources/views/home.antlers.html

<div>
<b>first</b>
{{ partial:partial_a }}
  {{ partial:partial_b }}outside, {{ noparse }}inside noparse{{ /noparse }}{{ /partial:partial_b }}
{{ /partial:partial_a }}
</div>

<div>
<b>second</b>
{{ partial:partial_a }}
  {{ partial:partial_b }}outside, {{ noparse }}inside noparse{{ /noparse }}{{ /partial:partial_b }}
{{ /partial:partial_a }}
</div>

<div>
<b>third</b>
{{ partial:partial_a }}
  {{ partial:partial_b }}outside, {{ noparse }}inside noparse{{ /noparse }}{{ /partial:partial_b }}
{{ /partial:partial_a }}
</div>

<div>
<b>fourth</b>
{{ partial:partial_a }}
  {{ partial:partial_b }}outside, {{ noparse }}inside noparse{{ /noparse }}{{ /partial:partial_b }}
{{ /partial:partial_a }}
</div>

In the browser call the url that renders the resources/views/home.antlers.html template file.

The rendered view will be:

first outside, inside noparse
second outside, inside noparse
third outside,
fourth outside,

The string inside noparse is missing from the third onwards

Logs

Environment

Environment
Application Name: Statamic
Laravel Version: 11.43.2
PHP Version: 8.3.12
Composer Version: 2.8.2
Environment: local
Debug Mode: ENABLED
URL: statamic_empty_project.test
Maintenance Mode: OFF
Timezone: UTC
Locale: en

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: NOT CACHED

Drivers
Broadcasting: log
Cache: file
Database: sqlite
Logs: stack / single
Mail: log
Queue: sync
Session: file

Statamic
Addons: 1
Sites: 1
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 5.x-dev Solo

Statamic Addons
statamic/ssg: 3.1.0

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

@sosias sosias changed the title {{ noparse }} issue in nested partials with {{ slot }} {{ noparse }} disappear in nested partials with {{ slot }} Feb 21, 2025
@sosias sosias changed the title {{ noparse }} disappear in nested partials with {{ slot }} {{ noparse }} content disappear in nested partials with {{ slot }} Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants