summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2024-04-14 14:12:10 +0200
committerFlorian Pritz <bluewind@xinu.at>2024-04-14 14:20:00 +0200
commit076c9dd5fafff150d5618c20383a83bcc563c020 (patch)
treed0ea243d23968ef36f11cc84c498863020cd3fad
parent7d8b8ee29ebc8f15b7eab5f8ca6cf2532f2bd61f (diff)
fix(pygments): Improve systemd file detection
Improved version of 4c6c4b8c19797333b4d93a266afd7f243694d875 since my test file was detected as text/plain, not as application/x-wine-extension-ini. Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r--NEWS1
-rw-r--r--application/libraries/Pygments.php13
2 files changed, 13 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index b70320d2b..94d42811c 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,7 @@
This file lists major, incompatible or otherwise important changes, you should look at it after every update.
NEXT
+ - Fix syntax highlighting for systemd files
- Fix password reset trying to send mails to deleted users
4.0.1 2024-01-14
diff --git a/application/libraries/Pygments.php b/application/libraries/Pygments.php
index b4f465219..9386da418 100644
--- a/application/libraries/Pygments.php
+++ b/application/libraries/Pygments.php
@@ -115,7 +115,7 @@ class Pygments {
'application/x-shellscript' => 'bash',
'application/xslt+xml' => "xml",
'application/x-x509-ca-cert' => 'text',
- 'application/x-wine-extension-ini' => 'systemd',
+ 'application/x-wine-extension-ini' => 'ini',
'message/rfc822' => 'text',
'text/css' => 'css',
'text/html' => 'xml',
@@ -191,12 +191,14 @@ class Pygments {
}
$extensionarray = array(
+ 'automount' => 'systemd',
'awk' => 'awk',
'c' => 'c',
'cast' => 'asciinema',
'coffee' => 'coffee-script',
'cpp' => 'cpp',
'cr' => 'crystal',
+ 'device' => 'systemd',
'diff' => 'diff',
'go' => 'go',
'h' => 'c',
@@ -212,8 +214,10 @@ class Pygments {
'mli' => 'ocaml',
'mll' => 'ocaml',
'mly' => 'ocaml',
+ 'mount' => 'systemd',
'mysql' => 'mysql',
'patch' => 'diff',
+ 'path' => 'systemd',
'pgsql' => 'postgresql',
'php' => 'php',
'pl' => 'perl',
@@ -225,10 +229,17 @@ class Pygments {
'rb' => 'ruby',
'rs' => 'rust',
's' => 'asm',
+ 'scope' => 'systemd',
+ 'service' => 'systemd',
'sh' => 'bash',
+ 'slice' => 'systemd',
+ 'socket' => 'systemd',
'sql' => 'sql',
+ 'swap' => 'systemd',
+ 'target' => 'systemd',
'tcl' => 'tcl',
'tex' => 'tex',
+ 'timer' => 'systemd',
'yml' => 'yaml',
);
if (array_key_exists($extension, $extensionarray)) return $extensionarray[$extension];