cm-editor-syntax-highlight-obsidian icon indicating copy to clipboard operation
cm-editor-syntax-highlight-obsidian copied to clipboard

Request: be more flexible for language tags in Python

Open xavdid opened this issue 3 years ago • 4 comments

I noticed that the editor doesn't do highlighting unless the full name of the language is used:

Both render correctly in preview mode:

Other languages don't seem to have this problem- Typescript code is highlighted in the editor for both ts and typescript. Python seems to be catching an odd case here.

xavdid avatar May 08 '21 23:05 xavdid

A temporary solution is to add alias: ["py"] in <vault>/.obsidian/plugins/cm-editor-syntax-highlight-obsidian/main.js line 174:

{name: "Python", mime: "text/x-python", mode: "python", ext: ["BUILD", "bzl", "py", "pyw"], alias: ["py"], file: /^(BUCK|BUILD)$/},

gbrlb avatar Sep 30 '21 03:09 gbrlb

The same thing with shell and bash working, but sh isn't.

mikkovedru avatar Oct 16 '21 11:10 mikkovedru

For me, sh works in edit mode but not in preview mode.

gbrlb avatar Oct 18 '21 13:10 gbrlb

The same for me.

It would be nice to have sh as an alias for bash and shell.

mikkovedru avatar Oct 18 '21 13:10 mikkovedru