// ==UserScript==
// @name PMC: Inline Code
// @namespace tampermonkey.net/
// @version 1.0
// @description Add inline code abilities to PMC
// @author ExpertCoder14
// @match *://www.planetminecraft.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
window.addEventListener('load', function() {
$('head').append("<style> code { display: inline; padding: 1px; padding-left: 3px; padding-right: 3px;} br + code {display: block; padding: 10px;}</style>");
}, false);
})();Reload the page and you'll quickly realize that inline code spans are awesome!<code> for a code block, which is a terrible choice. The correct HTML for a code block is <pre> and the whole meaning for <code> is for inline code.<code style="display: inline;">minecraft:</code><span style="font-family: monospace;"></span>Since 2010, 5.7 million Minecraft fans have joined PMC to create, share, and grow together. Whether you're here to browse, show your support or level up your skills, you're invited to be part of our community.
Join for free
Inline code blocks
{"rewards": {
"function": "minecraft:root"
},
"criteria": {
"tick": {
"trigger": "minecraft:tick",
"conditions": {}
}
},
"requirements": [
[
"tick"
]
]
}
However, attempting to use inline code blocks causes the text below to be shown instead:
A simple workaround is to highlight text in light blue as shown below:
A new text format can be added to support inline code blocks and grant more freedom to creators, and then the existing code block format can be renamed afterwards if appropriate.