Skip to content

Commit cb87725

Browse files
committed
Remove local workaround from Java, introduce a testcase for ".keyword"
1 parent 4bb70ad commit cb87725

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

src/languages/java.js

-9
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,6 @@ function(hljs) {
2525
hljs.C_BLOCK_COMMENT_MODE,
2626
hljs.APOS_STRING_MODE,
2727
hljs.QUOTE_STRING_MODE,
28-
{
29-
/*
30-
Local workaround for a general problem.
31-
The begin regex constructed from `beginKeywords` has no way to ensure the absence of
32-
the dot before the identifier, so the word "class" in `obj.class()` triggers the whole
33-
class mode. Ugliness ensues.
34-
*/
35-
begin: '\\.' + hljs.UNDERSCORE_IDENT_RE, relevance: 0
36-
},
3728
{
3829
beginKeywords: 'protected public private', end: /[{;=]/,
3930
keywords: KEYWORDS,

src/test.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ <h2>Automatically detected languages</h2>
776776
<pre><code>function $initHighlight(block, flags) {
777777
try {
778778
if (block.className.search(/\bno\-highlight\b/) != -1)
779-
return processBlock(block, true, 0x0F) + ' class=""';
779+
return processBlock(block.function, true, 0x0F) + ' class=""';
780780
} catch (e) {
781781
/* handle exception */
782782
var e4x =

0 commit comments

Comments
 (0)