Last active
May 30, 2023 19:54
-
-
Save f5-rahm/a983c40ce7b7fbc1d61a8406b95a2683 to your computer and use it in GitHub Desktop.
DevCentral code block client-side fix with Tampermonkey
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name DC Code Tag Fix v2 | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author Jason Rahm w/ ChatGPT Assist | |
// @match https://community.f5.com/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=f5.com | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var html = document.body.innerHTML; | |
// Replace <CODE> tags w/ generic pre syntax | |
// html = html.replace(/<CODE>/gi, '<pre class="lia-code-sample"><code>'); | |
// Replace <CODE> tags w/ Tcl syntax highlighting | |
html = html.replace(/<CODE>/gi, '<pre class="lia-code-sample language-tcl"><code>'); | |
// Replace </CODE> tags | |
html = html.replace(/<\/CODE>/gi, '</code></pre>'); | |
document.body.innerHTML = html; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment