2021-01-24, 08:23 PM
Right now we've got this regex:
and this replacement:
The result kinda works as intended, but only if the page contains only one folder. If there's more than one, clicking any button only opens/closes the first one on the page.
How do we change this?
\[folder=(.*?)](^$)*(.*?)(^$)*\[/folder\]
and this replacement:
<button title="Click to show/hide" type="button" onclick="if(document.getElementById('spoiler') .style.display=='none') {document.getElementById('spoiler') .style.display=''}else{document.getElementById('spoiler') .style.display='none'}">$1</button>
<div id="spoiler" style="display:none">
$3
</div>
The result kinda works as intended, but only if the page contains only one folder. If there's more than one, clicking any button only opens/closes the first one on the page.
How do we change this?