| r2698 vs r2699 | ||
|---|---|---|
| ... | ... | |
| 233 | 233 | == 나무나무마크구상2 == |
| 234 | 234 | 할거 : wiki/darkstyle/+/-/#fff |
| 235 | 235 | 리터럴귀찮음 if folding syntax는 될리가없음 |
| 236 | input='냥\{\{\{#!html 냥<div style="color: red; display: inline">냥</div>\}\}\}냥\{\{\{#!wiki style="color: blue; display: inline"<br>냥텍스트\}\}\}asdf\{\{\{#;color:red,#f00 asdf\}\}\}' | |
| 236 | input='냥\{\{\{#!html 냥<div style="color: red; display: inline">냥</div>\}\}\}냥\{\{\{#!wiki style="color: blue; display: inline"<br>냥텍스트\}\}\}asdf\{\{\{#;color:red,#f00 asdf\}\}\}\{\{\{+1 size\}\}\}' | |
| 237 | 237 | ##괄호를 ) 를 찾고 (를 나중에 찾는 방식이라(이게 로직이 더 간단함 근데 처리부분 길어지면 바꿀수도) input에 다른 거 오면 창남ㅇㅇ |
| 238 | 238 | |
| 239 | 239 | {{{#!wiki style="display: none" |
| 240 | {{{#!if input='냥\{\{\{#!html 냥<div style="color: red; display: inline">냥</div>\}\}\}냥\{\{\{#!wiki style="color: blue; display: inline"<br>냥텍스트\}\}\}asdf\{\{\{#;color:red,#f00 asdf\}\}\}' | |
| 240 | {{{#!if input='냥\{\{\{#!html 냥<div style="color: red; display: inline">냥</div>\}\}\}냥\{\{\{#!wiki style="color: blue; display: inline"<br>냥텍스트\}\}\}asdf\{\{\{#;color:red,#f00 asdf\}\}\}\{\{\{+1 size\}\}\}' | |
| 241 | 241 | }}} |
| 242 | 242 | ############################## |
| 243 | 243 | {{{#!if ParClose=input.indexOf('\}\}\}'), ParOpen=input.indexOf('\{\{\{'), Match=false, true |
| ... | ... | |
| 434 | 434 | }}} |
| 435 | 435 | }}} |
| 436 | 436 | }}} |
| 437 | ############################## | |
| 438 | {{{#!if ParClose=input.indexOf('\}\}\}'), ParOpen=input.indexOf('\{\{\{'), Match=false, true | |
| 439 | {{{#!if ParClose!=-1&&ParOpen!=-1&&ParClose>ParOpen | |
| 440 | {{{#!if _ParOpen = input.substring(ParOpen+3,ParClose).indexOf('\{\{\{') | |
| 441 | }}} | |
| 442 | {{{#!if _ParOpen == -1 | |
| 443 | {{{#!if Match=true | |
| 444 | }}} | |
| 445 | }}}{{{#!if _ParOpen != -1 | |
| 446 | {{{#!if ParOpen=_ParOpen | |
| 447 | }}} | |
| 448 | }}} | |
| 449 | ############################ | |
| 450 | {{{#!if _ParOpen = input.substring(ParOpen+3,ParClose).indexOf('\{\{\{') | |
| 451 | }}} | |
| 452 | {{{#!if _ParOpen == -1 | |
| 453 | {{{#!if Match=true | |
| 454 | }}} | |
| 455 | }}}{{{#!if _ParOpen != -1 | |
| 456 | {{{#!if ParOpen+=_ParOpen+3 | |
| 457 | }}} | |
| 458 | }}} | |
| 459 | ############################ | |
| 460 | {{{#!if _ParOpen = input.substring(ParOpen+3,ParClose).indexOf('\{\{\{') | |
| 461 | }}} | |
| 462 | {{{#!if _ParOpen == -1 | |
| 463 | {{{#!if Match=true | |
| 464 | }}} | |
| 465 | }}}{{{#!if _ParOpen != -1 | |
| 466 | {{{#!if ParOpen+=_ParOpen+3 | |
| 467 | }}} | |
| 468 | }}} | |
| 469 | }}} | |
| 437 | 470 | ########################### |
| 471 | {{{#!if Match | |
| 472 | {{{#!if input.substr(ParOpen, 9) == '\{\{\{#!html' | |
| 473 | {{{#!if input = input.substring(0,ParOpen)+input.substring(ParOpen+9,ParClose).trim()+input.substr(ParClose+3) | |
| 474 | }}} | |
| 475 | }}} | |
| 476 | {{{#!if input.substr(ParOpen, 9) == '\{\{\{#!wiki' | |
| 477 | {{{#!if BrL = input.substring(ParOpen,ParClose).indexOf('<br>'), StyleL = input.substring(ParOpen,ParClose).indexOf('style=') | |
| 478 | }}}{{{#!if BrL != -1 && StyleL!=-1 | |
| 479 | {{{#!if Text = input.substring(ParOpen+BrL+4,ParClose), Style=input.substr(ParOpen+StyleL,BrL-StyleL) | |
| 480 | }}}{{{#!if input = input.substring(0,ParOpen)+'<div '+Style+'>'+Text.trim()+'</div>'+input.substr(ParClose+3) | |
| 481 | }}} | |
| 482 | }}} | |
| 483 | }}} | |
| 484 | {{{#!if input.substr(ParOpen, 4) == '\{\{\{#' | |
| 485 | {{{#!if Blank = input.substring(ParOpen,ParClose).indexOf(' '), Comma = input.substring(ParOpen,ParClose).indexOf(',') | |
| 486 | }}}{{{#!if Blank!=-1 | |
| 487 | {{{#!if Comma != -1 | |
| 488 | {{{#!if WhiteColor=input.substr(ParOpen+3,Comma-3), DarkColor=input.substring(ParOpen+Comma+1,ParOpen+Blank) | |
| 489 | }}} | |
| 490 | }}} | |
| 491 | {{{#!if Comma == -1 | |
| 492 | {{{#!if WhiteColor=input.substr(ParOpen+3,Blank-3), DarkColor=WhiteColor | |
| 493 | }}} | |
| 494 | }}}{{{#!if Text = input.substring(ParOpen+Blank,ParClose) | |
| 495 | }}}{{{#!if input = input.substring(0,ParOpen)+'<div style="display: inline; color: '+WhiteColor+'">'+Text.trim()+'</div>'+input.substr(ParClose+3) | |
| 496 | ##유효성 검사는 뺌. 귀찮고 넣으면 길어짐. | |
| 497 | }}} | |
| 498 | }}} | |
| 499 | }}} | |
| 500 | {{{#!if input.substr(ParOpen, 4) == '\{\{\{+' || input.substr(ParOpen, 4) == '\{\{\{-' | |
| 501 | {{{#!if Blank = input.substring(ParOpen,ParClose).indexOf(' ') | |
| 502 | }}}{{{#!if Blank==5 | |
| 503 | {{{#!if Size=input.substr(ParOpen+Blank-2, 2) | |
| 504 | }}} | |
| 505 | ##ㅈㄴ귀찮게 하나하나 대응해야됨 | |
| 506 | {{{#!if Size == '+1' | |
| 507 | {{{#!if Em='1.28889em' | |
| 508 | }}} | |
| 509 | }}} | |
| 510 | {{{#!if Text = input.substring(ParOpen+Blank,ParClose) | |
| 511 | }}}{{{#!if input = input.substring(0,ParOpen)+'<div style="display: inline; font-size: '+Em+'">'+Text.trim()+'</div>'+input.substr(ParClose+3) | |
| 512 | }}} | |
| 513 | }}} | |
| 514 | }}} | |
| 438 | 515 | }}} |
| 516 | ########################### | |
| 517 | }}} | |
| 439 | 518 | |
| 440 | 519 | output: {{{#!html @input@}}} |
| 441 | 520 | == ㅁㄴㅇㄹ == |
| ... | ... |