diff --git a/plugins/Prism.php b/plugins/Prism.php index b5b9803..9af5473 100644 --- a/plugins/Prism.php +++ b/plugins/Prism.php @@ -15,12 +15,16 @@ class Prism > document.addEventListener('DOMContentLoaded', function () { document.querySelectorAll('[class^=jush-]').forEach(function ($item) { - let jush = $item.getAttribute('class').trim(); - let lang = jush.replace('jush-', 'language-'); - $item.setAttribute('class', lang); - // $item.classList.remove(jush); - // $item.classList.add(lang); + const current_class = $item.getAttribute('class').trim(); + const language_class = current_class.replace('jush-', 'language-'); + $item.setAttribute('class', language_class); }); + document.querySelectorAll('code').forEach(function ($item) { + const current_class = ($item.getAttribute('class') || '').trim(); + if (current_class === '') { + $item.setAttribute('class', 'language-plain'); + } + }) });