major
minor
defect
major
minor
When using highlightjs and requirejs, errors are logged if highlightjs is loaded after requirejs:
This is a known issue: 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 solution implemented for this ticket uses option 1.
Test
Temporarily add the dependencies for syntax highlighting and creating HTML-type attributes to the pom.xml for the graph demo: {{{#!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> }}} Start the Graph Demo, add an attribute of type HTML, fill it with code content, and then display it. No errors of the type described above should be logged in the browser’s developer console.