Skip to content
This repository was archived by the owner on Dec 25, 2021. It is now read-only.

Update highlight.js library with HLSL support and other improvements #1

Closed
wants to merge 655 commits into from

Conversation

loopervfx
Copy link

I am a graphics programmer and use Discord daily for solving problems and sharing code snippets with other developers in professional and educational settings.

While Discord's syntax highlighting is very helpful in this regard, it is lagging behind on highlight.js library's advancements by well over 1 year now. Many improvements, bugfixes and support for a number of new language grammars have been added to highlight.js since the last revision --one of the most important to the game developer industry being HLSL High-level shader language (HLSL.) it is currently the most ubiquitous language that shader code is authored in, in large part by its use in the Unity and Unreal real-time engines.

HLSL support in particular was added in version 10.7.0, with 10.7.3 being the last version before possible breaking changes arrived in 11.0.0. Or maybe you'll prefer to upgrade to the latest, It's up to you.

highlightjs#3002
https://github.com/highlightjs/highlight.js/blob/2dd87a6ef58c8c886dd209076aa6661ffae89577/CHANGES.md
https://support.discord.com/hc/en-us/community/posts/1500001411122-Update-highlight-js-library-to-10-7-1-bringing-HLSL-support-to-Game-developers-everywhere

Updating highlight.js has a relatively low effort and low risk factor but would benefit so many of us that work on videogames and interactive media using Discord to communicate everyday.

Feel free to close this draft PR and open up a new one as needed when this work can be done and from the best branch or commit, etc, I'm just making sure this actually is brought to the attention to fellow software developers as there has been no response to this via the support.discord.com and twitter.com/discord so I have no idea if the development team is even aware of these advancements and the difference it would make in the community.

Thank you

joshgoebel and others added 30 commits April 13, 2021 07:27
- Use `delphi` instead or add your own aliases
Builds the browser and CDN `highlight.js` as a single unit, as in
Rollup sees the entire dependency tree and can optimize it most
effectively.

Previously we compiled core separately and each languages separately.
The final distributable was then a concatenation of all these
separate builds - meaning that often it could include repeated
code from grammars pulling in the same dependencies (regex libs,
etc.)

The common build (minified) is now 20kb smaller which results
in a 4-5kb reduction in the gzip size.
Resolves #3023.

The prior behavior was inconsistent. Sometimes the language would not
get added at all. Language is now always added, and always prefixed. Ie, when
highlighting with csharp then language-csharp would be added to the
code element's className.

This also applies to sublanguage span tags which now will have the language-
prefix appended as well.

Note: classPrefix does not apply here, that is only used for themeing
classes, not for language classification.
…ts (#3007)

- drops the legacy `lib/highlight.js`
- build ES modules in `es` folder side-by-side with `lib` for CJS
- adds `lib/common`
- loader is no longer supported, languages must `export default` or equiv
- add --no-esm build option (for speed)
- add `.js.js` stubs for maximum compatible with requires using extensions
* add(wasm) WebAssembly support
* (chore) add web category
joshgoebel and others added 28 commits December 10, 2021 12:45
Version 2.28 related:

* complex and array types
* complex numbers
* added all new functions and distributions

Other Improvements:

* highlighting of constants
* highlighting for user defined distributions
* highlighting for truncation

Co-authored-by: Josh Goebel <[email protected]>
- also add `title.function.invoke` to the official list
  (Rust was already using)
- remove unnecessary `class` scope
- add `;` as punctuation
- remove deprecated `function` scope
- use `title.function` for function names
When  you clicked the badge it took you to "beginner friendly" instead of "good first issue"
@night
Copy link
Member

night commented Dec 24, 2021

thanks for the PR, but this fork only existed to upstream a security fix. we no longer rely on it.

@night night closed this Dec 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.