| r2687 vs r2688 | ||
|---|---|---|
| ... | ... | |
| 207 | 207 | == 나무나무마크구상2 == |
| 208 | 208 | 할거 : wiki/darkstyle/+/-/#fff |
| 209 | 209 | 리터럴귀찮음 if folding syntax는 될리가없음 |
| 210 | input='냥\{\{\{#!html 냥<div style="color: red; display: inline">냥</div>\}\}\}냥\{\{\{#!wiki style="color: blue; display: inline"<br>냥텍스트\}\}\}' | |
| 210 | input='냥\{\{\{#!html 냥<div style="color: red; display: inline">냥</div>\}\}\}냥\{\{\{#!wiki style="color: blue; display: inline"<br>냥텍스트\}\}\}asdf\{\{\{#;color:red,#f00 asdf\}\}\}' | |
| 211 | 211 | ##괄호를 ) 를 찾고 (를 나중에 찾는 방식이라(이게 로직이 더 간단함 근데 처리부분 길어지면 바꿀수도) input에 다른 거 오면 창남ㅇㅇ |
| 212 | 212 | |
| 213 | 213 | {{{#!wiki style="display: none" |
| 214 | {{{#!if input='냥\{\{\{#!html 냥<div style="color: red; display: inline">냥</div>\}\}\}냥\{\{\{#!wiki style="color: blue; display: inline"<br>냥텍스트\}\}\}' | |
| 214 | {{{#!if input='냥\{\{\{#!html 냥<div style="color: red; display: inline">냥</div>\}\}\}냥\{\{\{#!wiki style="color: blue; display: inline"<br>냥텍스트\}\}\}asdf\{\{\{#;color:red,#f00 asdf\}\}\}' | |
| 215 | 215 | }}}{{{#!if ParClose=input.indexOf('\}\}\}'), ParOpen=input.indexOf('\{\{\{'), Match=false, true |
| 216 | 216 | {{{#!if ParClose!=-1&&ParOpen!=-1&&ParClose>ParOpen |
| 217 | 217 | {{{#!if _ParOpen = input.substring(ParOpen+3,ParClose).indexOf('\{\{\{') |
| ... | ... | |
| 246 | 246 | }}} |
| 247 | 247 | ########################### |
| 248 | 248 | {{{#!if Match |
| 249 | {{{#!if | |
| 249 | {{{#!if input.substr(ParOpen, 9) == '\{\{\{#!html' | |
| 250 | 250 | {{{#!if input = input.substring(0,ParOpen)+input.substring(ParOpen+9,ParClose).trim()+input.substr(ParClose+3) |
| 251 | 251 | }}} |
| 252 | 252 | }}} |
| 253 | {{{#!if | |
| 253 | {{{#!if input.substr(ParOpen, 9) == '\{\{\{#!wiki' | |
| 254 | 254 | {{{#!if BrL = input.substring(ParOpen,ParClose).indexOf('<br>'), StyleL = input.substring(ParOpen,ParClose).indexOf('style=') |
| 255 | 255 | }}}{{{#!if BrL != -1 && StyleL!=-1 |
| 256 | 256 | {{{#!if Text = input.substring(ParOpen+BrL+4,ParClose), Style=input.substr(ParOpen+StyleL,BrL-StyleL) |
| ... | ... | |
| 295 | 295 | }}} |
| 296 | 296 | ########################### |
| 297 | 297 | {{{#!if Match |
| 298 | {{{#!if | |
| 298 | {{{#!if input.substr(ParOpen, 9) == '\{\{\{#!html' | |
| 299 | 299 | {{{#!if input = input.substring(0,ParOpen)+input.substring(ParOpen+9,ParClose).trim()+input.substr(ParClose+3) |
| 300 | 300 | }}} |
| 301 | 301 | }}} |
| 302 | {{{#!if | |
| 302 | {{{#!if input.substr(ParOpen, 9) == '\{\{\{#!wiki' | |
| 303 | 303 | {{{#!if BrL = input.substring(ParOpen,ParClose).indexOf('<br>'), StyleL = input.substring(ParOpen,ParClose).indexOf('style=') |
| 304 | 304 | }}}{{{#!if BrL != -1 && StyleL!=-1 |
| 305 | 305 | {{{#!if Text = input.substring(ParOpen+BrL+4,ParClose), Style=input.substr(ParOpen+StyleL,BrL-StyleL) |
| ... | ... | |
| 310 | 310 | }}} |
| 311 | 311 | }}} |
| 312 | 312 | ############################## |
| 313 | {{{#!if ParClose=input.indexOf('\}\}\}'), ParOpen=input.indexOf('\{\{\{'), Match=false, true | |
| 314 | {{{#!if ParClose!=-1&&ParOpen!=-1&&ParClose>ParOpen | |
| 315 | {{{#!if _ParOpen = input.substring(ParOpen+3,ParClose).indexOf('\{\{\{') | |
| 316 | }}} | |
| 317 | {{{#!if _ParOpen == -1 | |
| 318 | {{{#!if Match=true | |
| 319 | }}} | |
| 320 | }}}{{{#!if _ParOpen != -1 | |
| 321 | {{{#!if ParOpen=_ParOpen | |
| 322 | }}} | |
| 323 | }}} | |
| 324 | ############################ | |
| 325 | {{{#!if _ParOpen = input.substring(ParOpen+3,ParClose).indexOf('\{\{\{') | |
| 326 | }}} | |
| 327 | {{{#!if _ParOpen == -1 | |
| 328 | {{{#!if Match=true | |
| 329 | }}} | |
| 330 | }}}{{{#!if _ParOpen != -1 | |
| 331 | {{{#!if ParOpen+=_ParOpen+3 | |
| 332 | }}} | |
| 333 | }}} | |
| 334 | ############################ | |
| 335 | {{{#!if _ParOpen = input.substring(ParOpen+3,ParClose).indexOf('\{\{\{') | |
| 336 | }}} | |
| 337 | {{{#!if _ParOpen == -1 | |
| 338 | {{{#!if Match=true | |
| 339 | }}} | |
| 340 | }}}{{{#!if _ParOpen != -1 | |
| 341 | {{{#!if ParOpen+=_ParOpen+3 | |
| 342 | }}} | |
| 343 | }}} | |
| 344 | }}} | |
| 345 | ########################### | |
| 346 | {{{#!if Match | |
| 347 | {{{#!if input.substr(ParOpen, 9) == '\{\{\{#!html' | |
| 348 | {{{#!if input = input.substring(0,ParOpen)+input.substring(ParOpen+9,ParClose).trim()+input.substr(ParClose+3) | |
| 349 | }}} | |
| 350 | }}} | |
| 351 | {{{#!if input.substr(ParOpen, 9) == '\{\{\{#!wiki' | |
| 352 | {{{#!if BrL = input.substring(ParOpen,ParClose).indexOf('<br>'), StyleL = input.substring(ParOpen,ParClose).indexOf('style=') | |
| 353 | }}}{{{#!if BrL != -1 && StyleL!=-1 | |
| 354 | {{{#!if Text = input.substring(ParOpen+BrL+4,ParClose), Style=input.substr(ParOpen+StyleL,BrL-StyleL) | |
| 355 | }}}{{{#!if input = input.substring(0,ParOpen)+'<div '+Style+'>'+Text.trim()+'</div>'+input.substr(ParClose+3) | |
| 356 | }}} | |
| 357 | }}} | |
| 358 | }}} | |
| 359 | {{{#!if input.substr(ParOpen, 4) == '\{\{\{#' | |
| 360 | {{{#!if Blank = input.substring(ParOpen,ParClose).indexOf(' '), Comma = input.substring(ParOpen,ParClose).indexOf(',') | |
| 361 | }}}{{{#!if Blank!=-1 | |
| 362 | {{{#!if Comma != -1 | |
| 363 | {{{#!if WhiteColor=input.substr(ParOpen+3,Comma-3), DarkColor=input.substring(ParOpen+Comma+1,ParOpen+Blank) | |
| 364 | }}} | |
| 365 | }}} | |
| 366 | {{{#!if Comma == -1 | |
| 367 | {{{#!if WhiteColor=input.substr(ParOpen+3,Blank-3), DarkColor=WhiteColor | |
| 368 | }}} | |
| 369 | }}}{{{#!if Text = input.substring(ParOpen+Blank,ParClose) | |
| 370 | }}}{{{#!if input = input.substring(0,ParOpen)+'<div style="display: inline; color: '+WhiteColor+'">'+Text.trim()+'</div>'+input.substr(ParClose+3) | |
| 371 | ##유효성 검사는 뺌. 귀찮고 넣으면 길어짐. | |
| 372 | }}} | |
| 373 | }}} | |
| 374 | @WhiteColor@ @DarkColor@ | |
| 375 | }}} | |
| 376 | }}} | |
| 313 | 377 | }}} |
| 378 | ########################### | |
| 379 | ||
| 314 | 380 | output: {{{#!html @input@}}} |
| 315 | 381 | == ㅁㄴㅇㄹ == |
| 316 | 382 | [include(a)]''''''[include(a)][include(a)] |
| ... | ... |