All the code examples display on one line in Firefox.
I installed Tampermonkey and added this script to fix the problem:
// ==UserScript==
// @name Fix Stimulus Code Blocks
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Add line breaks to code blocks
// @match https://stimulus.hotwired.dev/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
// Wait for page to load
setTimeout(() => {
document.querySelectorAll('pre.language-html code').forEach(code => {
// Replace double spaces with <br> + double spaces
code.innerHTML = code.innerHTML.replace(/>\s{2}</g, '><br> <');
});
}, 500);
})();
All the code examples display on one line in Firefox.
I installed Tampermonkey and added this script to fix the problem: