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

Missing entities option in XMLBuilder #655

Open
3 of 6 tasks
marcoreni opened this issue May 24, 2024 · 2 comments
Open
3 of 6 tasks

Missing entities option in XMLBuilder #655

marcoreni opened this issue May 24, 2024 · 2 comments

Comments

@marcoreni
Copy link

  • Are you running the latest version?
  • Have you included sample input, output, error, and expected output?
  • Have you checked if you are using correct configuration?
  • Did you try online tool?

Description

Builder has an "entities" property that specifies some replacement on entities:

However, this property is not documented nor on XMLBuilderProperties:

type XmlBuilderOptions = {

It seems possible to override it, but I'm not sure if this is meant to be "internal" or can be exposed/documented.

Input

Code

const builder = new XMLBuilder({
// Object literal may only specify known properties, and 'entities' does not exist in type 'XmlBuilderOptions'.ts(2353)
	entities: [
		{ regex: new RegExp("&", "g"), val: "&" }, //it must be on top
		{ regex: new RegExp(">", "g"), val: "FOO" },
		{ regex: new RegExp("<", "g"), val: "BAR" },
		{ regex: new RegExp("'", "g"), val: "HELLO" },
	],
});

Output

expected data

Would you like to work on this issue?

  • Yes
  • No

Bookmark this repository for further updates. Visit SoloThought to know about recent features.

Copy link

We're glad you find this project helpful. We'll try to address this issue ASAP. You can vist https://solothought.com to know recent features. Don't forget to star this repo.

@amitguptagwl
Copy link
Member

don't remember exactly, but I wanted to keep it n the same as parser

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

No branches or pull requests

2 participants