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

Preserve certain text from being escaped #188

Open
ernieIzde8ski opened this issue Sep 22, 2023 · 2 comments
Open

Preserve certain text from being escaped #188

ernieIzde8ski opened this issue Sep 22, 2023 · 2 comments

Comments

@ernieIzde8ski
Copy link

ernieIzde8ski commented Sep 22, 2023

Is your feature request related to a problem? Please describe.

In a project, I need to preserve ampersands inside text so that I can have the following nodes:

	<class> &InventoryMenu; </class>
	<alpha>	0 </alpha> 
	<locus> &true; </locus>

However, inserting an ampersand as normal results in it being escaped to &amp. I couldn't tell if there were some mechanism in the library for preventing that behavior already, but it would be useful to have one.

Describe the solution you'd like

A backwards-slash-based solution seems the most straightforward, like:

{
    "class": "\\&InventoryMenu;",
    "alpha": 0,
    "locus": "\\&true;"
}

Describe alternatives you've considered

Some macro-based solutions came to mind, but none that seemed reasonable.

@vinitkumar
Copy link
Owner

Thanks for reporting this. I will need to think about a way to implement it in a backward compatible way. Let me get back to you on this.

@vinitkumar
Copy link
Owner

@ernieIzde8ski I just looked into this. It looks like escaping is the correct thing to do in this case and there is no good way to implement this without breaking backward compatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants