Skip to content

Minifying templates breaks when two consecutive comments exist and first is // #34880

Closed
@iwkse

Description

@iwkse

I've noticed when you use // with phtml the static generator is going to strip the comment, it doesn't happen the same when using # or /* */

Preconditions (*)

Tested with 2.4.2

Steps to reproduce (*)

  1. Write in a phtml template file, something like:
<span><?php // foo ?><?php // bar ?></span>

Expected result (*)

<span><?php ?><?php ?></span>

Actual result (*)

<span><?php</span>

  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: FrameworkIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: doneReported on 2.4.2Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions