sublimehq / Packages

Syntax highlighting files shipped with Sublime Text and Sublime Merge
https://sublimetext.com
Other
2.95k stars 588 forks source link

[PHP] block comments are not working as expected if they are placed inside a <script> tag #3812

Open arasanoutdoinc opened 1 year ago

arasanoutdoinc commented 1 year ago

What happened?

image

After applying the patch from this GitHub repository: https://github.com/jfcherng-sublime/ST-my-settings/blob/master/scripts/update_official_packages.sh, the overall functionality seems to be working fine.

However, there is an issue with the PHP block comment inside the script tag, which is not functioning correctly.

followed by #3811

michaelblyons commented 1 year ago

It's always helpful to include your sample code as text as well as the screenshot, so testers can copy it without retyping.

deathaxe commented 1 year ago

PHP tags are embedded in CSS/JavaScript to keep syntax size and complexity in sane limits.

https://github.com/sublimehq/Packages/blob/74c43d2261024008fd4fae2e7abc8d154f7d5baf/PHP/JavaScript%20(PHP).sublime-syntax#L37-L45

PHP Source.sublime-syntax is mainly designed to switch between html<->php.

Not sure what a solution would look like without risk of hitting 25k context sanity limit and keep already significant complexity in sane limits.

It's hard to mix 2 context sensitive syntaxes such as PHP and JavaScript without bloating resource usage and complexity.

Not sure whether its worth for such a tiny edge case. There are likely more when using PHP within JS/CSS. Those are designed to take simple php expressions only.