Syntax highlighting for code blocks without specifying the language

syntax highlighting for code blocks without specifying the language. While traditional syntax highlighting relies on language detection to colorize code, what if we explored the possibility of highlighting code blocks without indicating the language explicitly?

Doubling this. There is a Code Block plugin, but it’s manual.

VS Code supports this from 2021, it’s powered by TensorFlow.js—opensource library which uses Guesslang—also open source, so implementing it should be fairly straightforward.
I’m assuming Notion uses something similar for their code blocks—and there it works fully automatically.

Hello,

I saw this suggestion and really liked the idea, so I made a plugin for this.

Repo: botre/obsidian-auto-code-fence-language

Currently awaiting review.

It uses Guesslang under the hood, as suggested by @cMepTHuk

1 Like

I built a plugin for this use case as well.

Repo: bueckerlars/obsidian-codeblock-language-detector

The plugin is currently under review.

It uses highlight.js and custom user-defined pattern matching.

@botre Unfortunately, I noticed too late that you had already built a plugin for this use case. If you’d like, we could merge our plugins.

1 Like

Dear @botre @bueckerlars, thank you both for your work, was the review successful? I’m unable to find any of the plugins in the Community plugins.

1 Like

Hey @cMepTHuk. I am waiting for a review since August 27th.

If you want to try the plugin you can install it with BRAT.

1 Like