Openui5: Demo Kit: migrate to another syntax highlighter

Created on 15 Sep 2020  路  3Comments  路  Source: SAP/openui5

The code prettifier _Prettify_ is frequently used in UI5, mainly for the Demo Kit. But:

One of the alternatives is highlight.js.

  • It's actively maintained.
  • Stack Overflow recently moved to highlight.js.
  • According to their performance benchmark, highlight.js scored better than Prettify consistently across all browsers.
  • Can be used in a worker thread, as a ES6 module, and in NodeJS.
  • It does a good job at what it's supposed to do - highlighting:
    xml highlighting with highlight js

Surely there are also other tools which could replace Prettify. Anyhow, switching to a "better" highlighter, that actually works, would improve the quality of the documentation of UI5.

enhancement in progress

Most helpful comment

Hello, we will open an internal development task to migrate the syntax highlighter although I cannot promise it will be 100% highlight.js.

All 3 comments

Hello @boghyon ,
Thank you for sharing your enhancement proposal. I've created an internal incident 2070325863. The status of the issue will be updated here in GitHub.

Regards,
Tsanislav

Hello, we will open an internal development task to migrate the syntax highlighter although I cannot promise it will be 100% highlight.js.

In case highlight.js is considered: there is currently a bug since version 10.4.0 with XML code having a single-letter namespace prefix: https://github.com/highlightjs/highlight.js/issues/2957 (FIXED by @Hirse. Thanks! 馃憤)

Was this page helpful?
0 / 5 - 0 ratings