← Retour au blog
tech 27 August 2026

Emacs 31: An Unofficial Guide to Markdown-ts-mode

Explore the innovative features of the new markdown-ts mode in Emacs 31, a revolutionary approach to Markdown editing.

Article inspired by the original source
Emacs 31: An unofficial guide to Markdown-ts-mode ↗ rahuljuliato.com

Introduction

The release of Emacs 31 brought with it a host of new features, among which the "markdown-ts-mode" stands out. Marked as experimental, it raises questions: is it ready for use? What advantages does it offer? This guide will help you activate this mode and understand its features.

Understanding markdown-ts-mode

The `markdown-ts-mode` in Emacs 31 is designed to provide a rich Markdown editing experience. Although experimental, it already supports the CommonMark specification and most Github Flavored Markdown (GFM) extensions. It includes features such as code blocks for languages not supported by Tree-sitter, table of contents utilities, and interfaces with external converters like Pandoc and GFM.

Installation and Configuration

Given its experimental status, the markdown-ts mode is not enabled by default. You need to load the library manually. Here’s an example configuration using `use-package`:

``lisp (use-package markdown-ts-mode :ensure nil :mode ("\\.md\\'" "\\.mdx\\'" "\\.markdown\\'") :config (require 'markdown-ts-mode-x)) ``

If you prefer a non-`use-package` approach:

``lisp (autoload 'markdown-ts-mode "markdown-ts-mode" nil t) (dolist (re '("\\.md\\'" "\\.mdx\\'" "\\.markdown\\'")) (add-to-list 'auto-mode-alist (cons re 'markdown-ts-mode))) (with-eval-after-load 'markdown-ts-mode (require 'markdown-ts-mode-x)) ``

Key Features

  1. Extensive Markdown Support: Covers CommonMark and GFM specifications.
  2. Integration with Tree-sitter: Offers advanced syntax parsing for text editing.
  3. External Interfaces: Connects with Pandoc for robust file conversions.
  4. Table of Contents Utilities: Facilitates navigation in lengthy documents.

Practical Use

To activate this mode without affecting your current configuration, create a `testing.el` file with the above configuration, then run Emacs with:

`` emacs -Q --load 'testing.el' ``

Why Adopt It?

Despite its experimental status, Emacs 31's `markdown-ts-mode` stands out due to its functional richness and flexibility. It is particularly useful for developers who frequently work with Markdown and seek to optimize their workflow.

Conclusion

The `markdown-ts-mode` brings a new dimension to Markdown editing in Emacs. If you are ready to experiment and contribute to its development, it could become an essential tool in your toolkit.

Let's discuss your project in 15 minutes.

---

Emacs 31 markdown-ts-mode Tree-sitter Markdown Pandoc
Deepthix newsletter · 100% AI · every Monday 8am

An AI agent reads tech for you.

Our AI agent scans ~200 sources per week and ships the best articles to your inbox Monday 8am. Free. One click to unsubscribe.

Visit the newsletter page →

Want to automate your operations?

Let's talk about your project in 15 minutes.

Book a call