ZeeZide / CodeEditor

A SwiftUI TextEditor with syntax highlighting using Highlight.js
MIT License
448 stars 57 forks source link

No API to add a language/custom highlightr js source #35

Open SoylentGraham opened 3 hours ago

SoylentGraham commented 3 hours ago

I want to highlight a language that highlightr.js supports, but is not in this/https://github.com/raspu/Highlightr 's minified build of the js lib.

https://github.com/raspu/Highlightr seems to support a custom highlight.js build, in it's constructor, but I'm not seeing a way to set this up with this package.

I presume that is the intended approach of using specific/additional languages, so the swiftui interface needs a way to pass the highlightr lib path down the chain

SoylentGraham commented 2 hours ago

Steps to make custom language build

Then to integrate with my changes

SoylentGraham commented 2 hours ago

Also needed to change dependency of Highlightr to use 2.2.1 to support current (11.10.0) builds out of highlightr.js