You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
While prism understands namespace declaration (namespace Hello), namespace definition (use Hello) and using classes with namespaces (new \Hello\Hi(); and \Hello\Hi::class), it doesn't understand function namespaces. In PHP, functions can be namespaced as well.
mb_string(); // call to a global function\mb_string(); // namespace \ is global\a\b\c\mb_string(); // function in \a\b\c namespace
In Prism.js, the namespace parts \a\b\c are makred as .token.plain, which I don't believe they are.
Technical tips:
Only calls to methods need this checks - so it must be \w+\\\w+\(\). Namespaces and functions cannot start with letter. There can't be a space between namespaces and functions as well as between namespaces and backslashes.
Information:
Description
While prism understands namespace declaration (
namespace Hello
), namespace definition (use Hello
) and using classes with namespaces (new \Hello\Hi();
and\Hello\Hi::class
), it doesn't understand function namespaces. In PHP, functions can be namespaced as well.In Prism.js, the namespace parts
\a\b\c
are makred as.token.plain
, which I don't believe they are.Technical tips:
Only calls to methods need this checks - so it must be
\w+\\\w+\(\)
. Namespaces and functions cannot start with letter. There can't be a space between namespaces and functions as well as between namespaces and backslashes.Example
https://prismjs.com/test.html#language=php&text=%3Cphp%0A%0Aecho%20%5Cmy%5Chello%5Cmy_function()%3B%0A
The text was updated successfully, but these errors were encountered: