17,260
edits
(re-added backslashed multiquote support, clarified the code) |
(optimized loops, made code ugly. note to self: use sub-templates to reduce code duplication.) |
||
Line 1: | Line 1: | ||
<onlyinclude>{{#vardefine:usedelim|}} | <onlyinclude>{{#vardefine:usedelim|}}{{#if: {{#explode:{{{2|}}}|\|1}} | ||
| {{#vardefine:ctr|-1}}{{#while: | {{#vardefineecho:slashquote|{{#explode:{{{2|}}}|\|{{++|ctr}}}}}} | |||
| {{#if: {{#explode:{{#var:slashquote}}|-|1}} | |||
| {{#vardefine:first|{{#explode:{{#var:slashquote}}|-|0}}}}{{#vardefine:last|{{#explode:{{#var:slashquote}}|-|1}}}}<!-- | |||
-->{{#loop: qid | {{#var:first}} | {{#expr:{{!!=|last|{{#var:first}}}}-{{#var:first}}+1}} | -->{{#loop: qid | {{#var:first}} | {{#expr:{{!!=|last|{{#var:first}}}}-{{#var:first}}+1}} | ||
| {{#if: {{#var:usedelim}} | | {{#if: {{#var:usedelim}} | ||
| {{!!=|dump-qdelim|{{{qdelim|{{S}}}}}}} | | {{!!=|dump-qdelim|{{{qdelim|{{S}}}}}}} | ||
| {{#vardefine:usedelim|true}} | | {{#vardefine:usedelim|true}} | ||
}} | }}{{:{{Zelda|{{{1}}}}} Text Dump/Select|{{#var:qid}}|{{!!=|dump-ldelim|{{{ldelim|{{S}}}}}}}}} | ||
}} | }} | ||
| {{#if: {{#var:usedelim}} | |||
| {{!!=|dump-qdelim|{{{qdelim|{{S}}}}}}} | |||
| {{#vardefine:usedelim|true}} | |||
}}{{:{{Zelda|{{{1}}}}} Text Dump/Select|{{#var:slashquote}}|{{!!=|dump-ldelim|{{{ldelim|{{S}}}}}}}}} | |||
}} | }} | ||
}} | |||
| {{#if: {{#explode:{{{2|}}}|-|1}} | |||
| {{#vardefine:first|{{#explode:{{{2|}}}|-|0}}}}{{#vardefine:last|{{#explode:{{{2|}}}|-|1}}}}<!-- | |||
-->{{#loop: qid | {{#var:first}} | {{#expr:{{!!=|last|{{#var:first}}}}-{{#var:first}}+1}} | |||
| {{#if: {{#var:usedelim}} | |||
| {{!!=|dump-qdelim|{{{qdelim|{{S}}}}}}} | |||
| {{#vardefine:usedelim|true}} | |||
}}{{:{{Zelda|{{{1}}}}} Text Dump/Select|{{#var:qid}}|{{!!=|dump-ldelim|{{{ldelim|{{S}}}}}}}}} | |||
}} | |||
| {{#if: {{#var:usedelim}} | |||
| {{!!=|dump-qdelim|{{{qdelim|{{S}}}}}}} | |||
| {{#vardefine:usedelim|true}} | |||
}}{{:{{Zelda|{{{1}}}}} Text Dump/Select|{{{2|}}}|{{!!=|dump-ldelim|{{{ldelim|{{S}}}}}}}}} | |||
}} | }} | ||
}}</onlyinclude> | }}</onlyinclude> |