Major
Detail
Bugfix
Major
Detail
When using highlightjs and requirejs, errors are logged if highlightjs is loaded after requirejs:
The problem is known: https: //github.com/highlightjs/highlight.js/issues/1288
There are two possible solutions:
- loadhighlightjs before requirejs is loaded
- loadhighlightjs using requirejs. For example: {{ #!js require('https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.6.0/highlight.min.js', function(hljs) { hljs.initHighlighting(); }); }}}
The implemented solution of the ticket uses variant 1.
Test
Temporarily add to the graph demo the dependencies for syntax highlighting and creating attributes of type HTML of pom.xml: {{#!xml <dependency> <groupId>com.top-logic</groupId> <artifactId>tl-model-wysiwyg</artifactId> </dependency> <dependency> <groupId>com.top-logic</groupId> <artifactId>tl-layout-wysiwyg-highlighter</artifactId> </dependency> }}} Launch graph demo, add HTML type attribute, populate with code content and then display. No error of the above construction should be logged in the browser's developer console.