silverbulletmd / silverbullet

The knowledge hacker's notebook
https://silverbullet.md
MIT License
2.14k stars 155 forks source link

Add Powershell Syntax Highlighting #706

Closed CyberPenguin closed 5 months ago

CyberPenguin commented 5 months ago

Please could Powershell syntax highlighting be added to codeblocks?

Reproduce Issue

  1. Insert code block and after the first ``` enter either ps or powershell
  2. No syntax highlighting provided
zefhemel commented 5 months ago

Should be easy to do. There is a power shell highlighter in legacy modes: https://github.com/codemirror/legacy-modes/tree/main/mode

Which needs to imported here: https://github.com/silverbulletmd/silverbullet/blob/main/common/languages.ts

I can do this after my vacation, but happy to take a PR that adds this.

zefhemel commented 5 months ago

On discord somebody asked for diff, may well add that one too while at it. And potentially more languages in that list.

giovannipollo commented 5 months ago

I can try to do it. It should not be hard, also if it's my first time with Typescript. If you assign it to me, I will do it ASAP.

zefhemel commented 5 months ago

Great!

giovannipollo commented 5 months ago

I think this issue can be closed, since it has been solved!