BreakingLineCode

Ajoute un retour à la ligne automatique pour la balise code.

目前为 2024-04-21 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name BreakingLineCode
  3. // @namespace Forum
  4. // @author Isilin
  5. // @date 21/04/2024
  6. // @version 1.0
  7. // @description Ajoute un retour à la ligne automatique pour la balise code.
  8. // @license WTF Public License; http://en.wikipedia.org/wiki/WTF_Public_License
  9. // @include https://www.dreadcast.net/Forum
  10. // @include https://www.dreadcast.net/Forum#
  11. // @include https://www.dreadcast.net/FAQ
  12. // @include https://www.dreadcast.net/FAQ#
  13. // @include https://www.dreadcast.net/Forum/*
  14. // @include https://www.dreadcast.net/FAQ/*
  15. // @include https://www.dreadcast.net/EDC
  16. // @include https://www.dreadcast.net/EDC/*
  17. // @compat Firefox, Chrome
  18. // @grant GM_addStyle
  19. // @run-at document-start
  20. // ==/UserScript==
  21.  
  22. (function() {
  23. let css = `
  24. pre {
  25. white-space: pre-wrap !important;
  26. white-space: moz-pre-wrap !important;
  27. white-space: -pre-wrap !important;
  28. white-space: -o-pre-wrap !important;
  29. line-height: 22px !important;
  30. }
  31. `;
  32. if (typeof GM_addStyle !== "undefined") {
  33. GM_addStyle(css);
  34. } else {
  35. let styleNode = document.createElement("style");
  36. styleNode.appendChild(document.createTextNode(css));
  37. (document.querySelector("head") || document.documentElement).appendChild(styleNode);
  38. }
  39. })();