Open snixtho opened 1 year ago
It fails parsing the file when using < or >, but this is a limitation of the xml spec, which does not allow these characters inside of attribute values. Right now, xml escape characters have to be used. < and > should be replaced by < and > respectively.
If we want to allow the characters inside of values, we will probably need a different xml parser or do some preprocessing before parsing the file, replacing those characters by their escape sequences.
We just need to put the maniascript inside a comment, then it works. The template engine can do this automatically.
Then we are talking about different things.
But doesn't this already cause an issue when trying to compile an template which has <script>a <=> b</script>
in it?
You might want to use < or > in condition blocks as well, which causes this issue as well. That's is why we are using escape sequences currently. https://github.com/EvoEsports/ManiaTemplates/blob/b5e0abea15afc61ae00349ba38ded6a5db84cf4c/tests/ManiaTemplates.Tests/IntegrationTests/templates/nested-controls.mt#L7
Then we are talking about different things.
But doesn't this already cause an issue when trying to compile an template which has
<script>a <=> b</script>
in it?You might want to use < or > in condition blocks as well, which causes this issue as well. That's is why we are using escape sequences currently.
The error im talking about happens on the game server, not in the engine. And things like <> is already escaped by the engine in attributes afaik.
The common technique for Maniascript is to essentially put it inside an XML comment.
It appears that the script tags after rendering is not surrounded by a comment. So when you use characters such as < and > it will return a fault as the server fails to parser the XML. For example, when using the
<=>
operator, it fails.