diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2024-10-23 06:49:17 +0000 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2024-10-23 06:49:17 +0000 |
| commit | ecfb7a18021c8941fa6f059d35ec900d7bd148f1 (patch) | |
| tree | 9bb478b0e78509ed373481834006a6e961170384 /lib | |
| parent | aba98a03c4ca0125f561ec1792f827452803e989 (diff) | |
fix syntax highlighting, fixes #4650
Closes #4650
Merge request studip/studip!3459
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/classes/StudipCoreFormat.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/classes/StudipCoreFormat.php b/lib/classes/StudipCoreFormat.php index 7e3358c..718d10f 100644 --- a/lib/classes/StudipCoreFormat.php +++ b/lib/classes/StudipCoreFormat.php @@ -501,9 +501,11 @@ class StudipCoreFormat extends TextFormat $codetype = " ".decodeHTML(trim(mb_substr($matches[1], 1)), ENT_QUOTES); } $code = decodeHTML(trim($matches[2]), ENT_QUOTES); - return sprintf('<pre class="usercode %1$s"><code class="%1$s">%2$s</code></pre>', - htmlReady($codetype), - htmlReady($code)); + return sprintf( + '<pre><code class="%s">%s</code></pre>', + $codetype ? htmlReady("language-{$codetype}") : '', + htmlReady($code) + ); } /** |
