bug#81524: 32.0.50; String highlighting state bleeds into subsequent code blocks in markdown-ts-mode

Adam Niederer <[email protected]> Fri, 31 Jul 2026 00:17:04 -0400
Newsgroups gmane.emacs.bugs
Message-ID <CAALAvQXwo15hWxYoEEYhbJBPBP2D2ZcY-j+Gx=V7GutYKGEq3w@mail.gmail.com>
Minimal repro steps:

- emacs -Q
- M-x markdown-ts-mode
- Insert the following content

```elisp
"
```

```elisp
highlighted as a string
```

Expected behavior:

- The text "highlighted as a string" is highlighted with the colors of
the default face (black)

Observed behavior:

- The text "highlighted as a string" is highlighted with the colors of
the string face (reddish brown)

The face at point in both blocks is markdown-ts-in-code-block

In GNU Emacs 32.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.52, cairo version 1.18.4) of 2026-07-19 built on pc
Repository revision: 0f086c307c12b74aeedfba07cfe5b57ef2f99808
Repository branch: master
System Description: Arch Linux

Configured using:
 'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --mandir=/usr/share/man --with-gameuser=:games
 --with-modules --without-m17n-flt --without-gconf
 --with-native-compilation=yes --with-native-compilation=aot
 --with-xinput2 --with-pgtk --without-xaw3d --with-sound=no
 --with-tree-sitter 'CFLAGS=-march=native -mtune=native -O2 -pipe
 -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat
 -Werror=format-security -fstack-clash-protection -fcf-protection'
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LCMS2 LIBOTF LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY
PDUMPER PGTK PNG RSVG SECCOMP SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS
TREE_SITTER WEBP XIM GTK3 ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=fcitx5
  locale-coding-system: utf-8-unix

Major mode: Markdown

Minor modes in effect:
  markdown-ts-table-mode: t
  markdown-ts-code-block-context-mode: t
  markdown-ts-code-block-in-context-mode: t
  outline-minor-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  minibuffer-nonselected-mode: t
  minibuffer-regexp-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug lisp-mnt message mailcap yank-media puny
dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg
rfc6068 epg-config gnus-util time-date mm-decode mm-bodies mm-encode
mailabbrev gmm-utils mailheader sendmail mail-parse rfc2231 rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils cl-extra help-mode
comp-run bytecomp byte-compile comp-common rx yaml-ts-mode cl-seq
html-ts-mode sgml-mode facemenu dom markdown-ts-mode xref
text-property-search project ring goto-addr thingatpt noutline outline
icons subr-x mule-util treesit cl-loaddefs cl-lib rmc iso-transl tooltip
cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
elisp-mode mwheel term/pgtk-win pgtk-win term/common-win touch-screen
pgtk-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list
replace newcomment text-mode lisp-mode prog-mode register page tab-bar
menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse
jit-lock font-lock syntax font-core term/tty-colors frame minibuffer
nadvice seq simple cl-generic indonesian philippine cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop
case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads dbusbind inotify dynamic-setting system-font-setting
font-render-setting cairo gtk pgtk lcms2 multi-tty move-toolbar
make-network-process tty-child-frames native-compile emacs)

Memory information:
((conses 16 83965 14210) (symbols 48 8329 0) (strings 32 22717 2393)
 (string-bytes 1 754881) (vectors 16 13079)
 (vector-slots 8 183582 7542) (floats 8 38 1) (intervals 56 317 0)
 (buffers 1064 11))