TinyMCE BBCode: Convert UL -


i'm overpowered, maybe can't see correct way fix it.

below bbcode

function rep(re, str) {     s = s.replace(re, str); };  //replace ul rep(/<ul>(.*?)<\/ul>/gi,"[list]$1[/list]");  // replace li rep(/<li>(.*?)<\/li>/gi,"[*]$1"); 

test text:

<ul>     <li>one</li>     <li>two</li> </ul> 

converted result bbcode:

<ul>     [*]one     [*]two </ul> 

expected result:

[list]     [*]one     [*]two [/list] 

what wrong?

i fixed it. posting others.

// lists

rep(/<ul>/gi,"[list]"); rep(/<\/ul>/gi,"[/list]"); rep(/<ol>/gi,"[list=ol]"); rep(/<\/ol>/gi,"[/list]"); rep(/<li>(.*?)<\/li>/gi,"[*]$1"); 

Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -