From 2b1a69a6fa9208a7c2cc32a3de17185b930da454 Mon Sep 17 00:00:00 2001 From: Andrzej Ratajczak Date: Tue, 16 Mar 2021 14:21:40 +0100 Subject: [PATCH] Fix hljs highlighting for safari browser --- scaladoc/resources/dotty_res/scripts/hljs-scala3.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scaladoc/resources/dotty_res/scripts/hljs-scala3.js b/scaladoc/resources/dotty_res/scripts/hljs-scala3.js index c625ce8c1647..be39911c2f21 100644 --- a/scaladoc/resources/dotty_res/scripts/hljs-scala3.js +++ b/scaladoc/resources/dotty_res/scripts/hljs-scala3.js @@ -5,7 +5,7 @@ function highlightDotty(hljs) { const capitalizedId = /\b[A-Z][$\w]*\b/ const alphaId = /[a-zA-Z$_][$\w]*/ const op = /[^\s\w\d,"'()[\]{}]+/ - const id = new RegExp(`(${alphaId.source}((?<=_)${op.source})?|${op.source}|\`.*?\`)`) + const id = new RegExp(`(${alphaId.source}((?:_)(${op.source}))?|${op.source}|\`.*?\`)`) // numbers const hexDigit = '[a-fA-F0-9]' @@ -36,7 +36,7 @@ function highlightDotty(hljs) { function titleFor(name) { return { className: 'title', - begin: `(?<=${name} )${id.source}` + begin: `((?:${name} )(${id.source})` } } @@ -207,7 +207,7 @@ function highlightDotty(hljs) { }, { className: 'link', - begin: /(?<=\[.*?\])\(/, end: /\)/, + begin: /(?:\[.*?\])(\()/, end: /\)/, } ] }) @@ -343,7 +343,7 @@ function highlightDotty(hljs) { { // case A, B, C className: 'title', - begin: `(?<=(case|,) *)${id.source}` + begin: `(?:(case|,)( *))${id.source}` }, PARAMS, EXTENDS_PARENT,