多目的実験室

var ReshapeSimpleArticleList = {
    Reshape:function(id){
           var element = document.querySelector('#' + id);
           var innerCode = element.innerHTML;
           var target = innerCode.match(/\[\[div\s*class=\"foldable\-list\-container\"\]\][\s\S]*?\[\[\/div\]\]/g);
           for(var i = 0;i < target.length;i++){
                 let single = target[i];
                 let fulltitle = single.match(/\*.*\n/g);
                 fulltitle = fulltitle[fulltitle.length-1];
                 let reshaping = single.replace(/\[\[(|\/)div(\]\]|[^\]\]]*\]\])/g,'');
                 reshaping = reshaping.replace(fulltitle,'\n');
                 reshaping = reshaping.replace(/\]\]\s*\-[\s\S]*\n/,']] - ');
                 fulltitle = (fulltitle.replace(/\s*\*\s*/,'')) + '\n';
                 reshaping += fulltitle;
                 innerCode = innerCode.replace(single,reshaping);
 
           }
           element.innerHTML = innerCode;
    },
    ReserveReshaping:function(id){
        document.addEventListener('DOMContentLoaded',function(){
            ReshapeSimpleArticleList.Reshape(id);
          });
    }
 
}

test4

特に指定がない限り、このサイトのコンテンツには次のライセンスが適用されます: Creative Commons Attribution-ShareAlike 3.0 License