Skip to content

Commit

Permalink
enh(autodetect) php: prevent beginKeywords double relevancy
Browse files Browse the repository at this point in the history
  • Loading branch information
joshgoebel committed Oct 9, 2020
1 parent 26f24ac commit f9f3bc8
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/languages/php.js
Expand Up @@ -122,6 +122,7 @@ export default function(hljs) {
},
{
className: 'function',
relevance: 0,
beginKeywords: 'fn function', end: /[;{]/, excludeEnd: true,
illegal: '[$%\\[]',
contains: [
Expand All @@ -147,20 +148,27 @@ export default function(hljs) {
},
{
className: 'class',
beginKeywords: 'class interface', end: '{', excludeEnd: true,
beginKeywords: 'class interface',
relevance: 0,
end: '{',
excludeEnd: true,
illegal: /[:\(\$"]/,
contains: [
{beginKeywords: 'extends implements'},
hljs.UNDERSCORE_TITLE_MODE
]
},
{
beginKeywords: 'namespace', end: ';',
beginKeywords: 'namespace',
relevance: 0,
end: ';',
illegal: /[\.']/,
contains: [hljs.UNDERSCORE_TITLE_MODE]
},
{
beginKeywords: 'use', end: ';',
beginKeywords: 'use',
relevance: 0,
end: ';',
contains: [hljs.UNDERSCORE_TITLE_MODE]
},
STRING,
Expand Down

0 comments on commit f9f3bc8

Please sign in to comment.