Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong gfm-view-mode syntax highlight if only using *-ts-mode (tree-sitter modes) #824

Open
LionyxML opened this issue Feb 26, 2024 · 1 comment

Comments

@LionyxML
Copy link

Expected Behavior

(gfm-mode)

```typescript

const result = 1 + 1;

console.log(result);
```

to be rendered as (gfm-view-mode):
image

Actual Behavior

(gfm-mode)

```typescript

const result = 1 + 1;

console.log(result);
```

being rendered as (gfm-view-mode):
image

Steps to Reproduce

Have a system configured for treating typescript with treesitter and have no typescript-mode installed (such a config can be find here: https://github.com/LionyxML/lemacs/blob/main/init.el).

Open a new buffer and paste the content:
```typescript

const result = 1 + 1;

console.log(result);
```

Remove the \ as this is only for writing it here on github...

Run M-x gfm-view mode.

Note:
This problem goes away if I do install typescript-mode:

(use-package typescript-mode
  :defer t
  :ensure t)

Problem is that treesit modes replaces lots of "classic style modes", some for which there's actually no "mode package" for Emacs, but there's a tree sitter parser (like some obscure parsers you can find on this list: https://github.com/nvim-treesitter/nvim-treesitter).

Is there a way of making markdown-mode see "typescript" and actually use "typescript-ts-mode" for syntax highlighting?

A list converting modes or a global option to turn on/off such feature would be really nice.

Backtrace

No backtrace

Software Versions

  • Markdown Mode: Melpa Version markdown-mode-20240107.831
  • Emacs: GNU Emacs 29.2 (build 2, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw3d scroll bars) of 2024-01-21
  • OS: Linux debian 6.1.0-18-amd64 # 1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 GNU/Linux
@kiennq
Copy link

kiennq commented Apr 16, 2024

In the mean time, I guess something like (fset 'typescript-mode 'typescript-ts-mode) might work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants