mirror of
https://github.com/CoeJoder/lessfilter-pygmentize.git
synced 2025-11-15 16:43:47 -05:00
Fix #2 and update .lessfilter to Pygments v2.14.0
This commit is contained in:
@@ -22,8 +22,8 @@ for path in "$@"; do
|
||||
*)
|
||||
# unrecognized filename/extension
|
||||
# attempt to parse the lexer from the shebang if it exists
|
||||
lexer=$(head -n 1 "$path" |grep "^#\!" |awk -F" " \
|
||||
'match($1, /\/(\w*)$/, a) {if (a[1]!="env") {print a[1]} else {print $2}}')
|
||||
lexer=$(head -n 1 "$path" | grep '^#\!' | awk -F" " \
|
||||
'{ if (/env/) { print $2 } else { sub( /.*\//, ""); print $1;} }')
|
||||
case "$lexer" in
|
||||
node|nodejs)
|
||||
# workaround for lack of Node.js lexer alias
|
||||
|
||||
Reference in New Issue
Block a user