Search...Search plugins and themes...
⌘K
Sign in
  • Get started
  • Download
  • Pricing
  • Enterprise
  • Account
  • Obsidian
  • Overview
  • Sync
  • Publish
  • Canvas
  • Mobile
  • Web Clipper
  • CLI
  • Learn
  • Help
  • Developers
  • Changelog
  • About
  • Roadmap
  • Blog
  • Resources
  • System status
  • License overview
  • Terms of service
  • Privacy policy
  • Security
  • Community
  • Plugins
  • Themes
  • Discord
  • Forum / 中文论坛
  • Merch store
  • Brand guidelines
Follow us
DiscordTwitterBlueskyThreadsMastodonYouTubeGitHub
© 2026 Obsidian

Extended Code Highlight

Dong YangDong Yang317 downloads

Additional and configurable syntax highlighting for code block languages.

Add to Obsidian
  • Overview
  • Scorecard
  • Updates8

Extended Code Highlight adds broader, theme-compatible syntax highlighting for Obsidian code blocks in Reading view, Source mode, and Live Preview.

It supports all bundled PrismJS languages, bundled CodeMirror parser languages, and optional regex languages loaded from JSON files.

🚀 Features

  • Highlights more code block languages in both Reading view and editor views.
  • Supports every PrismJS language id and alias bundled with the plugin.
  • Uses CodeMirror parser highlighting where bundled parser support exists.
  • Keeps highlighted code blocks editable in Live Preview.
  • Reuses Obsidian's native .token.* and .cm-* theme classes.
  • Lets you add custom regex-based languages as JSON files.

🌐 Language Support

Use the normal language name after a fenced code block, such as js, ts, python, json, css, html, glsl, svelte, vue, zig, nix, or wasm.

The plugin supports:

  • Every PrismJS language bundled from the PrismJS supported language list.
  • Every CodeMirror parser language bundled in this plugin.
  • Embedded regex fallback languages.
  • User-defined regex languages that use the same JSON format.

You can check the upstream language lists here:

  • PrismJS supported languages: prismjs.com/#supported-languages
  • CodeMirror parser packages: codemirror.net/#language-support

Embedded fallback languages currently cover MLIR and Lean. Other bundled languages use PrismJS and/or CodeMirror support.

Highlighting priority depends on the Obsidian view:

  • Reading view: PrismJS grammar first, then CodeMirror parser translated to Prism-style .token.* spans, then regex fallback.
  • Source mode and Live Preview: CodeMirror parser first, then PrismJS token stream translated to Obsidian/CodeMirror .cm-* classes, then regex fallback.
  • Regex JSON languages always use their token rules.

If a language is not built in, add a JSON file for it.

🧩 Examples

```glsl
uniform sampler2D tex;

void main() {
  vec4 color = texture2D(tex, vec2(0.5));
}
```
```svelte
<script lang="ts">
  export let name = "world";
</script>

{#if name}
  <h1>Hello {name}</h1>
{/if}
```

⚙️ Custom Languages

Create one JSON file per language in the plugin's languages folder:

<your-vault>/.obsidian/plugins/extended-code-highlight/languages/

Example:

{
  "id": "mydsl",
  "aliases": ["my-dsl"],
  "tokens": [
    { "name": "comment", "pattern": ";.*", "flags": "m" },
    { "name": "keyword", "pattern": "\\b(foo|bar|baz)\\b" },
    { "name": "number", "pattern": "\\b\\d+(?:\\.\\d+)?\\b" },
    { "name": "string", "pattern": "\"(?:\\\\.|[^\"\\\\])*\"" }
  ]
}

Supported token names include comment, keyword, string, number, builtin, variable, function, property, and operator.

After editing a language JSON file, run the Reload extended highlight languages command or disable and re-enable the plugin.

🎨 Styling

The plugin uses Obsidian-compatible token classes so your current theme can style highlighted code.

Reading view uses Prism-style classes:

<span class="token keyword">...</span>

Editor views use CodeMirror-style classes:

cm-hmd-codeblock cm-keyword

📦 Installation

Copy these files into your plugin folder:

<your-vault>/.obsidian/plugins/extended-code-highlight/

Required files:

manifest.json
main.js

Obsidian's community plugin installer only downloads main.js, manifest.json, and styles.css when present. Built-in language fallbacks are embedded into main.js; create custom JSON language files manually only if you need local additions.

Then enable Extended Code Highlight in Obsidian's Community plugins settings.

HealthExcellent
ReviewPassed
About
Highlight code blocks across Reading view and Editor/Live Preview using Prism-compatible grammars and CodeMirror decorations. Add built-in support for WebAssembly, Zig, Nix, HCL, Svelte and more, and define custom languages with regex-based token rules in languages.json.
SyntaxLanguages
Details
Payments
Optional
Current version
1.1.3
Last updated
Last month
Created
2 months ago
Updates
8 releases
Downloads
317
Compatible with
Obsidian 1.5.0+
Platforms
Desktop, Mobile
License
MIT
Report bugRequest featureReport plugin
Author
Dong YangDong Yangydd0729
GitHubydd0729
  1. Community
  2. Plugins
  3. Syntax
  4. Extended Code Highlight

Related plugins

GDScript Syntax Highlighting

Add live GDScript syntax highlighting to code block.

CodeSuite

Execute code inside your notes: Shiki syntax highlighting with 65+ themes, live streaming output, inline Matplotlib and Plotly graphs, shared variables, and styled HTML and PDF export with outputs.

Simplified Chinese Word Splitting

Adds Simplified Chinese word splitting support for the editor and Vim mode.

Easy Typing

Auto format when typing.

LanguageTool

Unofficial integration of the LanguageTool spell and grammar checker.

VSCode Editor

Edit Code Files like VSCode.

Fountain Editor

Fountain (screenplay) syntax highlighting in the editor.

Dictionary

A multilingual dictionary that shows word definitions in the sidebar and popover synonyms.

YouVersion Linker

Automatically link bible verses in your notes to YouVersion bible.

Shiki Highlighter

Highlight code blocks with Shiki.