simple-code-editor icon indicating copy to clipboard operation
simple-code-editor copied to clipboard

Plans for integration hljs.highlightAuto()?

Open ChrisToxz opened this issue 1 year ago • 1 comments

Any plans to implement hljs.highlightAuto() from highlight.js for auto detection of the language? If not, plans to make a searchable language selector, as alternative?

I'm working on a local Snippet database tool. Having all languages available makes the dropdown list long and not 'easy' to pick the right language.

I'm now doing it as below, which works quite decent for already stored snippets, but feels kind of 'hackish' and does not work when writing a new snippet (yet).

const detectedLanguage = hljs.highlightAuto(props.resource.content)['language']
const language = [[detectedLanguage]]

ChrisToxz avatar Jun 13 '23 20:06 ChrisToxz

A searchable language selector seemed like a good idea.

justcaliturner avatar Jun 24 '23 15:06 justcaliturner