User:Ilikecomputers/cosmos.js: Difference between revisions

Everything About Fiction You Never Wanted to Know.
Content added Content deleted
(testing new JS)
 
(comments)
Line 1: Line 1:
//A very hackey way to fix a niche styling issue:
//A very hackey way to fix a niche styling issue:
//example markup:
//Example markup:
// * this is a bullet point
// * This is a bullet point
//** this is a quote
// ** {{quote|this is a quote}}
// **this is a bullet point after a quote <-- this will have double bullet points
// ** This is a bullet point after a quote <-- this will have double bullet points
document.querySelectorAll('table').forEach(function (e) {
document.querySelectorAll('table').forEach(function (e) {
if (e.nextElementSibling && e.nextElementSibling.nodeName === 'UL') {
if (e.nextElementSibling && e.nextElementSibling.nodeName === 'UL') {

Revision as of 22:24, 24 January 2023

//A very hackey way to fix a niche styling issue:
//Example markup:
//  * This is a bullet point
//  ** {{quote|this is a quote}}
//  ** This is a bullet point after a quote <-- this will have double bullet points
document.querySelectorAll('table').forEach(function (e) {
   if (e.nextElementSibling && e.nextElementSibling.nodeName === 'UL') {
    var sibling = e.nextElementSibling;
    if (sibling.childNodes[0].childNodes[0].nodeName === 'UL') {
    sibling.childNodes[0].classList.add('nodoublebullet');
    }
   }
})
document.styleSheets[0].insertRule(".nodoublebullet::marker {content: ''}")