function decodeNum(code){ var title = ""; code = code.substring(1, code.length); while(code.length > 0){ title += String.fromCharCode( parseInt(code.substring( 0, 3))); code = code.substring( 3, code.length); } return title; } function getmeta(meta,list){ var textB, textA, textL; var fulltext = document.getElementById(list).innerHTML; while(fulltext.indexOf("[[[") >= 0){ textB = fulltext.substring(0, fulltext.indexOf("[[[")); fulltext = fulltext.substring(fulltext.indexOf("[[[") + 2, fulltext.length); textA = fulltext.substring(fulltext.indexOf("]]]") + 3, fulltext.length); fulltext = fulltext.substring(0, fulltext.indexOf("]]]") + 1); if(fulltext.indexOf("|") >= 0){ textL = fulltext.substring(fulltext.indexOf("|") + 1, fulltext.length); fulltext = fulltext.substring(0, fulltext.indexOf("|")); }else{ textL = ""; } fulltext = fulltext.toLowerCase(); fulltext = fulltext.replace(/[^a-z0-9:\]\[]/g, "-"); while(fulltext.indexOf("--") >= 0){ fulltext = fulltext.replace( /--/g , "-" ) ; } fulltext = textB + fulltext + textL + textA; } while(fulltext.indexOf("/@/@") >= 0){ fulltext = fulltext.replace( "/@/@" , "" ) ; } //改行までの切り出し var fulltextSmall = fulltext.toLowerCase(); if(fulltextSmall.indexOf(meta)>=0){ fulltext = fulltext.substring(fulltextSmall.indexOf(meta), fulltext.length); fulltext = fulltext.substring(0, fulltext.indexOf("\n")); if(fulltext.indexOf("**") == 0 ){ fulltext = fulltext.replace( "**" , "" ) ; } //文字色付け while(fulltext.indexOf("##")>=0){ fulltext = fulltext.replace( "##" , "" ) ; fulltext = fulltext.replace( "##" , "" ) ; } //取り消し線 while(fulltext.indexOf("--")>=0){ fulltext = fulltext.replace( "--" , "" ) ; fulltext = fulltext.replace( "--" , "" ) ; } //ボールド while(fulltext.indexOf("**")>=0){ fulltext = fulltext.replace( "**" , "" ) ; fulltext = fulltext.replace( "**" , "" ) ; } //イタリック while(fulltext.indexOf("\/\/")>=0){ fulltext = fulltext.replace( "\/\/" , "" ) ; fulltext = fulltext.replace( "\/\/" , "" ) ; } //テレタイプ while(fulltext.indexOf("\{\{")>=0){ fulltext = fulltext.replace( "\{\{" , "" ) ; fulltext = fulltext.replace( "\}\}" , "" ) ; } //アンダーライン while(fulltext.indexOf("\_\_")>=0){ fulltext = fulltext.replace( "\_\_" , "" ) ; fulltext = fulltext.replace( "\_\_" , "" ) ; } //上付き while(fulltext.indexOf("\^\^")>=0){ fulltext = fulltext.replace( "\^\^" , "" ) ; fulltext = fulltext.replace( "\^\^" , "" ) ; } //下付き while(fulltext.indexOf("\,\,")>=0){ fulltext = fulltext.replace( "\,\," , "" ) ; fulltext = fulltext.replace( "\,\," , "" ) ; } //文字サイズ while(fulltext.indexOf("[[size")>=0){ fulltext = fulltext.replace( "[[size " , "" ) ; fulltext = fulltext.replace( "[[/size]]" , "" ) ; } //span要素 while(fulltext.indexOf("[[span")>=0){ fulltext = fulltext.replace( "[[span" , "" ) ; fulltext = fulltext.replace( "[[/span]]" , "" ) ; } while(fulltext.indexOf("[[/span]]")>=0){ fulltext = fulltext.replace( "[[/span]]" , "" ) ; } //[]部分の切り取り textA = fulltext; textL = ""; while(textA.indexOf("]") >= 0){ textB = textA.substring(0, textA.indexOf("]") + 1); textA = textA.substring(textA.indexOf("]") + 1, textA.length); if(textB.indexOf("[") >= 0){ textL += textB; } } textA = textL + textA; if(textA == ""){ if(fulltext.indexOf("|") >= 0){ fulltext = fulltext.substring(fulltext.indexOf("|") + 1, fulltext.indexOf("]")); }else{ fulltext = fulltext.substring(fulltext.indexOf(" ") + 1, fulltext.indexOf("]")); } }else{ fulltext = textA; } }else{ fulltext = ""; } return fulltext; }