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

Parse text value with an included (sub-) node #558

Open
4 tasks
araareon opened this issue Mar 21, 2023 · 3 comments
Open
4 tasks

Parse text value with an included (sub-) node #558

araareon opened this issue Mar 21, 2023 · 3 comments

Comments

@araareon
Copy link

araareon commented Mar 21, 2023

  • [x ] Are you running the latest version?
  • [x ] 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

My source file has a text value which is "interrupted" bay another node . I would like to maintain that structure.
The lib seems to wipe away the inner structure and creates a #text with the whole word "(Jahre)

Input

   <source> ( <x id="INTERPOLATION" equiv-text="{{ alter }}"/> Jahre ) </source>

Code

 const parserOptions = {
    parseTagValue: true, //default
    trimValues: true,
    ignoreAttributes: false,
    attributeNamePrefix : "@_"
}

Output

  <source>
          <x id="INTERPOLATION" equiv-text="{{ alter }}"></x>
(Jahre) </source>

expected data

I would like to keep the source data structure with the "(" before the <x..> and "Jahre )" after the </ x>

Just like the source

How can i achieve this?

Would you like to work on this issue?

  • Yes
  • No

Bookmark this repository for further updates.

@github-actions
Copy link

I'm glad you find this repository helpful. I'll try to address your issue ASAP. You can watch the repo for new changes or star it.

@amitguptagwl
Copy link
Member

There can be multiple possibilities. And for each, different options. You can probably try preserveOrder option. Please read docs for more detail and options.

@araareon
Copy link
Author

araareon commented Mar 24, 2023

preserveOrder works but the everything else gets ugly. This would be cool: #462
Perhaps it is possible with tagvalueProcessor/attributeValue processor..i will try

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