0 votes
by (160 points)
edited by

 I get an error that it cannot find a closing tag for macro <<replace>> with the following code. I presume this means it's not possible to nest replace macros. I don't need it to be able to handle it an arbitrary nor infinite number of times, it is a constant finite number of replaces needed. Is there a way to do this?

<span id="bulbTrap">
	[[Press the button labeled 1|Trapped]]<br>[[Press the button labeled 2|Trapped]]<br>
	<<link "Press the button labeled 3">>
		<<replace "#bulbTrap">>Nothing seems to have happened, press another button?<br>
			<<link "Press the button labeled 1">>
				<<replace "#bulbTrap">>
					All seems good again.<br>[[Press the button labeled 1|Trapped]]<br>[[Press the button labeled 2|Escaped]]<br>[[Press the button labeled 3|Trapped]]
				<</replace>>
			<</link>
			<br>[[Press the button labeled 2|Trapped]]<br>[[Press the button labeled 3|Trapped]]
		<</replace>>
	<</link>>
</span>

EDIT: Fixed typo Chapel discovered, behavior still the same.

1 Answer

+1 vote
by (63.1k points)
selected by
 
Best answer
Where is #bulbTrap? All I see is #bulbTrap1.
by (160 points)
Even after fixing that typo it still acts just the same.
by (63.1k points)
            <<link "Press the button labeled 1">>
				<<replace "#bulbTrap">>
					All seems good again.<br>[[Press the button labeled 1|Trapped]]<br>[[Press the button labeled 2|Escaped]]<br>[[Press the button labeled 3|Trapped]]
				<</replace>>
			<</link>

Missing a '>' on the <</link>> there.  Fixing that and the id made it work for me.

by (160 points)
Don't know how I missed that. I thought I had checked everything for that issue several times. Thanks!
by (63.1k points)
Sometimes you just need another set of eyes on it.
...