Enhancement
Major
Detail
Major
Detail
In the deployed TL-Doc, pages with code blocks are not displayed correctly:
The following message appears in the developer console:
top-logic.js?t=1647243919167:37472 Uncaught SyntaxError: Invalid regular expression: /\$+[a-zA-Z_�-??][a-zA-Z0-9_�-??]*/: Range out of order in character class at new RegExp (<anonymous>) at t (top-logic.js?t=1647243919167:37472:1988) at r (top-logic.js?t=1647243919167:37472:2427) at top-logic.js?t=1647243919167:37472:2721 at Array.forEach (<anonymous>) at r (top-logic.js?t=1647243919167:37472:2701) at l (top-logic.js?t=1647243919167:37472:2923) at f (top-logic.js?t=1647243919167:37472:4595) at top-logic.js?t=1647243919167:37472:5100 at Array.forEach (<anonymous>)
Switching to edit mode and back (regardless of whether changes were made), highlighting works again. The error is reproducible by clearing the cache and reloading the page.
On such "broken" pages, clicking on TLObject links also causes the page to reload.
Improvement
The problem arises from encoding issues when the js files are merged into one during deploy. This does not happen with a new highlight.js version. Therefore it was updated to the version on 11.5.0 and also implemented with maven dependencies (https://mvnrepository.com/artifact/org.webjars/highlightjs/11.5.0).
Test
Before testing, original-names must be set to false in /com.top_logic/src/main/webapp/WEB-INF/conf/enable-debug.config.xml:
<config service-class="com.top_logic.gui.JSFileCompiler"> <instance always-check="true" original-names="false" /> </config>
Then start the application and open a TL-Doc page that contains at least 2 code blocks. The code blocks must be properly formatted, i.e. have a background color and possibly different colorings of variables, functions, etc. Also, do not log any errors in the developer console. Also clear the cache and check if the blocks are still displayed correctly.