-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
(PHP) Attributes with \ highlighted as comment instead of meta #4115
Comments
What is the definition of an attribute in PHP, just |
Yes, Attributes are beginning with
Also, each attribute may have values associated with it, but doesn't have to, similar to how a constructor of a class works. Also Attributes can be nested. class Value
{
}
#[Attribute('value', new Value(), new Attribute()]
function foo() {} |
Could you test #4119? |
Yeah, this worked. So it was just the all uppercase.. :D I just realised that i found another case which is not correctly working: #[Event('car_ride.booked')]
final class RideBooked
{
public function __construct(
#[AccountNormalizer]
public readonly Account $account
){}
} Here, the attribute over a method argument of a function definition is not highlighted. |
Try that fix. |
Yes this works, thank you! Very much appreciate it! |
Describe the issue
Using Attributes with
\
are hilighted as comments instead of meta. If it's only a leading\
it is working as expected. But as soons as we add a\
after that, the highlighting is not correct anymore. This is a common situation when using attributes with PHP for example using Doctrine or Swagger etc.Which language seems to have the issue?
php
Are you using
highlight
orhighlightAuto
?highlight
Sample Code to Reproduce
Expected behavior
Same meta highlighting in these cases.
Additional context
Using highlight js through https://github.com/rehypejs/rehype-highlight which is using https://github.com/wooorm/lowlight. But i dont think the problem comes from there, since it's also wrong highlighted in the demo.
The text was updated successfully, but these errors were encountered: