Does anyone knows how to add custom BBCode to flarum?
I try to put the <script> below to the custom head and css to the custom css. The css works, but <script> doesn't work.
I flipped through the "extend.php" in several flarum bbcode plugin's github, I only understand that this page maybe is the key to import the converted code into the flarum js file, the other content is too difficult, I don’t understand How/ What / was making these convert code into Which flarum js file.....
<script>
function setupSpoiler() {
var postBody = $('#content');
if(postBody.length !== 0)
postBody.html(postBody.html().replace(/\[steam_spoiler\]/g, '<span class="steam_spoiler">').replace(/\[\/steam_spoiler\]/g, '</span>'));
}
</script>
.steam_spoiler {
color: #000000;
background-color: #000000;
padding: 0px 8px;
}
.steam_spoiler:hover {
color: #FFF;
}