Skip to content

Commit 2b1a69a

Browse files
committed
Fix hljs highlighting for safari browser
1 parent e08fd59 commit 2b1a69a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scaladoc/resources/dotty_res/scripts/hljs-scala3.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function highlightDotty(hljs) {
55
const capitalizedId = /\b[A-Z][$\w]*\b/
66
const alphaId = /[a-zA-Z$_][$\w]*/
77
const op = /[^\s\w\d,"'()[\]{}]+/
8-
const id = new RegExp(`(${alphaId.source}((?<=_)${op.source})?|${op.source}|\`.*?\`)`)
8+
const id = new RegExp(`(${alphaId.source}((?:_)(${op.source}))?|${op.source}|\`.*?\`)`)
99

1010
// numbers
1111
const hexDigit = '[a-fA-F0-9]'
@@ -36,7 +36,7 @@ function highlightDotty(hljs) {
3636
function titleFor(name) {
3737
return {
3838
className: 'title',
39-
begin: `(?<=${name} )${id.source}`
39+
begin: `((?:${name} )(${id.source})`
4040
}
4141
}
4242

@@ -207,7 +207,7 @@ function highlightDotty(hljs) {
207207
},
208208
{
209209
className: 'link',
210-
begin: /(?<=\[.*?\])\(/, end: /\)/,
210+
begin: /(?:\[.*?\])(\()/, end: /\)/,
211211
}
212212
]
213213
})
@@ -343,7 +343,7 @@ function highlightDotty(hljs) {
343343
{
344344
// case A, B, C
345345
className: 'title',
346-
begin: `(?<=(case|,) *)${id.source}`
346+
begin: `(?:(case|,)( *))${id.source}`
347347
},
348348
PARAMS,
349349
EXTENDS_PARENT,

0 commit comments

Comments
 (0)