Skip to content

Better markdown support #3218

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

Open
gytis-ivaskevicius opened this issue Feb 28, 2025 · 3 comments
Open

Better markdown support #3218

gytis-ivaskevicius opened this issue Feb 28, 2025 · 3 comments

Comments

@gytis-ivaskevicius
Copy link

Syntax:
I have noticed that markdown files with typescript code blocks (starts with ts or typescript) don't get highlighted. Maybe the treesitter package needs to be updated?

@eth-p
Copy link
Collaborator

eth-p commented Feb 28, 2025

Bat uses Sublime's .sublime-syntax highlighting definitions via the syntect library. TypeScript isn't included in the default Sublime syntax packages, which makes adding it as a Markdown code fence a bit more involved of a process.

More context from @keith-hall's comment here: #3148 (comment)

Related issue: #2084

@qtfkwk
Copy link

qtfkwk commented Mar 27, 2025

Seems like there are 2 distinct issues here:


One is convincing upstream @trishume / syntect to develop/add TypeScript to its default syntax packages. I've no idea about the LOE of that.


Another is making "container" formats support all (or all possible?) other formats... for example:

  • Markdown code blocks should/could support all formats (except maybe itself?)

    • (I've noticed other formats, like CSV, work fine directly, but not in a Markdown code block.)
  • Rust (.rs) should/could support Markdown inside comments... and make code blocks there with an empty info string automatically highlight as Rust (just an example of how deep the rabbit hole could go)

  • ... ?


Btw, I love bat! I use it all the time for many things. Thanks to @sharkdp and rest of the contributors for building and maintaining it!

@keith-hall
Copy link
Collaborator

One is convincing upstream @trishume / syntect to develop/add TypeScript to its default syntax packages.

No convincing needed, updating the sublimehq/Packages submodule will pull in TypeScript, including inside Markdown code blocks. But syntect``is a bit lacking support for newer sublime-syntax` features at the moment: trishume/syntect#570

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

No branches or pull requests

4 participants