Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested [insert_tag] calls do not work #8793

Open
CelticMinstrel opened this issue Apr 22, 2024 · 0 comments
Open

Nested [insert_tag] calls do not work #8793

CelticMinstrel opened this issue Apr 22, 2024 · 0 comments
Labels
Bug Issues involving unexpected behavior. Low Priority Issues that will cause no meaningful problems if left unaddressed. WML Issues involving the WML engine or WML APIs.

Comments

@CelticMinstrel
Copy link
Member

It would be natural to expect you can nest [insert_tag] calls in a similar way to how you can nest $ substitutions, but it does not work.

Example (in Lua for simplicity):

wml.array_access.set('madness', { {name = 'object', variable = 'object'}, {name = 'trait', variable = 'trait'}})
wml.array_access.set('object', {{id = 'one'},{id = 'two'}})
wml.array_access.set('trait', {{id='foo'},{id='bar'}})
print(wml.tostring(wml.tovconfig{wml.tag.insert_tag{name='insert_tag', variable='madness'}}))

This results in the following WML being printed to the console:

[insert_tag]
	name="object"
	variable="object"
[/insert_tag]
[insert_tag]
	name="trait"
	variable="trait"
[/insert_tag]

I would expect to instead see the following WML:

[object]
	id="one"
[/object]
[object]
	id="two"
[/object]
[trait]
	id="foo"
[/trait]
[trait]
	id="bar"
[/trait]

Note: This is definitely not a good first issue, as substitution of these tags is handled in two or three parallel places.

@CelticMinstrel CelticMinstrel added Bug Issues involving unexpected behavior. WML Issues involving the WML engine or WML APIs. Low Priority Issues that will cause no meaningful problems if left unaddressed. labels Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues involving unexpected behavior. Low Priority Issues that will cause no meaningful problems if left unaddressed. WML Issues involving the WML engine or WML APIs.
Projects
None yet
Development

No branches or pull requests

1 participant