Skip to content

Commit

Permalink
Script editor: Extend mode translation for more automation languages (o…
Browse files Browse the repository at this point in the history
…penhab#2760)

Signed-off-by: Florian Hotze <[email protected]>
  • Loading branch information
florian-h05 authored Sep 16, 2024
1 parent bd70e6b commit d84eed0
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,11 @@ export default {
// See https://codemirror.net/5/mode/index.html for supported language names & MIME types
if (!mode) return mode
if (mode.indexOf('yaml') >= 0) return 'text/x-yaml'
if (mode.indexOf('application/javascript') === 0 || mode === 'js') return 'text/javascript'
if (mode.startsWith('application/javascript') || mode === 'js') return 'text/javascript'
if (mode === 'application/vnd.openhab.dsl.rule') return 'text/x-java'
if (mode === 'py') return 'text/x-python'
if (mode === 'rb' || mode === 'application/x-ruby') return 'text/x-ruby'
if (mode === 'application/x-groovy' || mode === 'groovy') return 'text/x-groovy'
if (mode === 'application/x-python' || mode === 'py') return 'text/x-python'
if (mode === 'application/x-ruby' || mode === 'rb') return 'text/x-ruby'
if (mode.indexOf('jinja') >= 0) return 'text/jinja2'
return mode
},
Expand Down

0 comments on commit d84eed0

Please sign in to comment.