Skip to content

ERB parse error when yield is used with a || and block #1037

@kozy4324

Description

@kozy4324
<%= yield(:sidebar).presence || capture do %>
  default sidebar
<% end %>

The template above results in a parse error.
https://herb-tools.dev/playground#DwUgvABAnglgpgGwCYAoBcBnGS4CMCGATgJQB0ADoXBnAHYDGcEAPsxPfuQC4CuVESAPYQQAPgBQEAXABm+Hgi4QsOAoXGgIdJCNFA

This is valid Rails HTML+ERB code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions